# Meta-programming guide

**URL:** <https://discourse.julialang.org/t/meta-programming-guide/893>\
**Category:** General Usage\
**Tags:** announcement\
**Created:** [December 12, 2016, 4:19pm UTC](https://discourse.julialang.org/t/meta-programming-guide/893 "2016-12-12T16:19:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pitao/32/116_2.png) [@pitao](https://discourse.julialang.org/u/pitao)\
**Post date:** [December 12, 2016, 4:19pm UTC](https://discourse.julialang.org/t/meta-programming-guide/893/1 "2016-12-12T16:19:34Z")

</div>

I’ve written up the notes I took while learning basic concepts:

[https://github.com/p-i-/MetaGuideJulia/wiki](https://github.com/p-i-/MetaGuideJulia/wiki)

It is far from complete, and maybe needs to be split up into several pages.

Please feel very welcome to do some community editing magic and knock this into shape. If it’s hassle to do PRs, feel welcome to hand me a splat of text in the JuliaLang gitter and I will stick it in.

Maybe it can evolve into a proper learning resource…

I will keep nudging it as my own understanding improves.

Suggestions / feedback / content gladly received!

π

PS Is there a better category for this?

PPS I’ve also put it up here: [Documentation - Stack Overflow](http://stackoverflow.com/documentation/julia-lang/1945/metaprogramming) just because it’s easier for people to make edits I think. (I never figured out how to edit a GitHub project wiki) at time of writing it needs a couple of reviews before it goes visible.

---

<div class="post-metadata">

**Author:** ![jameson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jameson/32/23_2.png) [@jameson](https://discourse.julialang.org/u/jameson)\
**Post date:** [December 14, 2016, 7:32pm UTC](https://discourse.julialang.org/t/meta-programming-guide/893/2 "2016-12-14T19:32:06Z")

</div>

I’m not sure how to do a PR against a wiki on github (if it’s possible?).

So I figured I try to point out here that [https://github.com/p-i-/MetaGuideJulia/wiki#module-gotcha](https://github.com/p-i-/MetaGuideJulia/wiki#module-gotcha) should be mostly fixed now by [https://github.com/JuliaLang/julia/pull/15850](https://github.com/JuliaLang/julia/pull/15850) on v0.6 master.

Also, in the [https://github.com/p-i-/MetaGuideJulia/wiki#ismael-vc](https://github.com/p-i-/MetaGuideJulia/wiki#ismael-vc) example, you don’t want to call `esc(:(@util))` there since you want the hygienic macrocall, not the non-hygienic one. (only block and condition should be wrapped in `esc`).

Similarly for [https://github.com/p-i-/MetaGuideJulia/wiki#example-until-macro](https://github.com/p-i-/MetaGuideJulia/wiki#example-until-macro), you don’t want to call `esc(:!)`, only the block and condition should be wrapped in `esc`.

---

<div class="post-metadata">

**Author:** ![pitao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pitao/32/116_2.png) [@pitao](https://discourse.julialang.org/u/pitao)\
**Post date:** [December 18, 2016, 12:46pm UTC](https://discourse.julialang.org/t/meta-programming-guide/893/3 "2016-12-18T12:46:56Z")

</div>

DUH the wiki was only editable by myself.

I’ve flipped the switch. Now everyone can edit.

And please do!

Note that the bottom third hasn’t yet been structured / organised / polished. I need to go through that properly at some point (or someone does).
