Help with a macro inside module on 0.6

macros

#1

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?


#2

Yes, m needs to be escaped


#3

How do I do that? I tried to use esc(m) and I get the same error…


#4

You need to escape the expression, not the value. So println($(esc(l)), $(esc(:m)))


#5

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!