Skip to content

plot heatmap function gives a compile error when working on a variable from a global scope #106

@lwabeke

Description

@lwabeke

See the code snippet below for a smallest reproducible case

using PlotlyJS
let
    var = randn(10,5)
    global function P1()
        lay = Layout(;title="Dummy1")
        plot( heatmap( z=var ), lay )
     end  # function
    
    global function P2()
        lay = Layout(;title="Dummy2")
        plot( heatmap( z=randn(10,5) ), lay )
     end  # function

end # let

P2() works fine, but calling P1() which is essentially the same, give a compile error:

error compiling P1: unsupported or misplaced expression "quote" in function P1

If I am doing something wrong, I cannot think what. I guess I can work around it, by copying the variable into a local variable, but still

Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
In [48]:

Pkg.status()
19 required packages:
...

  • PlotlyJS 0.5.2
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions