# \`@def\` macro generator broken on master

**URL:** <https://discourse.julialang.org/t/def-macro-generator-broken-on-master/1096>\
**Category:** General Usage\
**Created:** [December 21, 2016, 7:15pm UTC](https://discourse.julialang.org/t/def-macro-generator-broken-on-master/1096 "2016-12-21T19:15:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 21, 2016, 7:56pm UTC](https://discourse.julialang.org/t/def-macro-generator-broken-on-master/1096/3 "2016-12-21T19:56:54Z")

</div>

I see, name wasn’t escaped:

```julia
macro def(name, definition)
    return quote
        macro $(esc(name))()
            esc($(Expr(:quote, definition)))
        end
    end
end
@def test begin
         a = 2
       end

# Now @test "pastes" the code `a=2`

```

is good now.

---

_[View the full topic](https://discourse.julialang.org/t/def-macro-generator-broken-on-master/1096)._
