Julia metaprograms: "ERROR: unsupported or inappropriate $ expression"

Why am I getting the error below? (I'm new to metaprogramming in Julia.) Thanks.

julia> d = :e

julia> macroexpand(:(b.$d))

julia> macroexpand(:($d.c))

julia> macroexpand(:(b.$d.c))
ERROR: unsupported or misplaced expression $

julia> macroexpand(:(b.$(d).c))
ERROR: unsupported or misplaced expression $



source to share

1 answer

It was a bug, the problem was here:


This has been fixed since then. As pointed out in the comments to the question, there are some hacky workarounds if you get stuck on Julia's uncommitted version, but hopefully you can update.



All Articles