Makie.jl icon indicating copy to clipboard operation
Makie.jl copied to clipboard

@recipe requires a backend to work

Open diegozea opened this issue 1 year ago • 6 comments

Hi!

I was trying to use the @recipe macro using only MakieCore but I found the following error (everything works fine when loading a backend):

(jl_knZW9b) pkg> st
      Status `/tmp/jl_knZW9b/Project.toml`
  [e9467ef8] GLMakie v0.6.10
  [20f20a25] MakieCore v0.3.5

julia> using MakieCore

julia> @recipe(StockChart) do scene
           Attributes()
       end
ERROR: LoadError: UndefVarError: @recipe not defined
in expression starting at REPL[5]:1

julia> MakieCore.@recipe(StockChart) do scene
           Attributes()
       end
ERROR: syntax: invalid syntax "MakieCore.@recipe # REPL[6], line 1 StockChart do scene
    # REPL[6], line 2
    Attributes()
end" around REPL[6]:1
Stacktrace:
 [1] top-level scope
   @ REPL[6]:1

julia> using GLMakie

julia> @recipe(StockChart) do scene
           Attributes()
       end

Cheers,

diegozea avatar Jul 18 '22 07:07 diegozea

Does @MakieCore.recipe work? I vaguely remember seeing this before.

jkrumbiegel avatar Jul 18 '22 07:07 jkrumbiegel

Oh! Yes! That's strange, isn't it?

julia> @MakieCore.recipe(StockChart) do scene
           Attributes()
       end


diegozea avatar Jul 18 '22 14:07 diegozea

wait hold up I thought

@A.a

and

A.@a

are exactly equivalent

Moelf avatar Jul 18 '22 14:07 Moelf

I have no idea 🤷

jkrumbiegel avatar Jul 18 '22 14:07 jkrumbiegel

Ok, I guess we are used to working with exported macros, but @recipe is not exported. I think that's the difference.

diegozea avatar Jul 18 '22 15:07 diegozea

This is a Julia bug and should be fixed in 1.8 (ref).

pfitzseb avatar Jul 18 '22 15:07 pfitzseb