# Looking for good macro examples

**URL:** <https://discourse.julialang.org/t/looking-for-good-macro-examples/450>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 20, 2016, 1:29pm UTC](https://discourse.julialang.org/t/looking-for-good-macro-examples/450 "2016-11-20T13:29:29Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [November 21, 2016, 12:38pm UTC](https://discourse.julialang.org/t/looking-for-good-macro-examples/450/9 "2016-11-21T12:38:20Z")

</div>

> [@Tamas\_Papp](#):
>
> I wish I could turn the whole hygiene mechanism off somehow.

You can, just put the whole quoted expression in `esc`.

```julia
module MM
foo(y) = println("foo was called with $y")
macro foo_fun(name, expr)
    x = gensym()
    esc(quote
        function $name($x)
            $MM.foo($x)
            $expr
        end
    end)
end
end

using MM: @foo_fun
@foo_fun bobby 45
bobby(4)

```

I haven’t written any macro-writing-macro yet, I’m not sure how that goes. Julia’s `quote` is a backquote, but you can get normal-quote by writing

```julia
y = :u
quote
    $(Expr(:quote, y))
end

```

It’s equivalent to `',` in Common Lisp.

---

_[View the full topic](https://discourse.julialang.org/t/looking-for-good-macro-examples/450)._
