Hello,
this macro inside the module works on 0.5 (prints 3101
). But on 0.6,
module MM
export tt
macro bla(l)
quote
println($(esc(l)),m)
end
end
function tt()
m=101
@bla 3
end
end
using MM
tt()
exits with the following error:
UndefVarError: m not defined
Is this intended?
Yes, m needs to be escaped
How do I do that? I tried to use esc(m)
and I get the same error…
You need to escape the expression, not the value. So println($(esc(l)), $(esc(:m)))
Thank you! I just figured it out, I don’t normally do any macros. I am trying to fix an un-maintained package that I use and that broke in 0.6.
Again, thanks!