# Help with a macro inside module on 0.6

**URL:** <https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569>\
**Category:** General Usage\
**Tags:** macros\
**Created:** [June 30, 2017, 4:37pm UTC](https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569 "2017-06-30T16:37:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raminammour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raminammour/32/13572_2.png) [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Post date:** [June 30, 2017, 4:37pm UTC](https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569/1 "2017-06-30T16:37:23Z")

</div>

Hello,

this macro inside the module works on 0.5 (prints `3101`). But on 0.6,

```julia
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?

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [June 30, 2017, 5:10pm UTC](https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569/2 "2017-06-30T17:10:04Z")

</div>

> [@raminammour](#):
>
> Is this intended?

Yes, m needs to be escaped

---

<div class="post-metadata">

**Author:** ![raminammour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raminammour/32/13572_2.png) [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Post date:** [June 30, 2017, 5:12pm UTC](https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569/3 "2017-06-30T17:12:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [June 30, 2017, 6:02pm UTC](https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569/4 "2017-06-30T18:02:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![raminammour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raminammour/32/13572_2.png) [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Post date:** [June 30, 2017, 6:07pm UTC](https://discourse.julialang.org/t/help-with-a-macro-inside-module-on-0-6/4569/5 "2017-06-30T18:07:16Z")

</div>

> [@yuyichao](#):
>
> $(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!
