# Using gensym properly

**URL:** <https://discourse.julialang.org/t/using-gensym-properly/3257>\
**Category:** General Usage\
**Tags:** macros, reactiveprogramming\
**Created:** [April 18, 2017, 12:58am UTC](https://discourse.julialang.org/t/using-gensym-properly/3257 "2017-04-18T00:58:06Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [April 18, 2017, 11:32am UTC](https://discourse.julialang.org/t/using-gensym-properly/3257/6 "2017-04-18T11:32:34Z")

</div>

> [@pyrex41](#):
>
> Additionally, arr is not defined in the global scope; as I understand it, it’s in something like a closure.

It actually is defined in a global scope, just with a gensym name so that it’s not named `arr` anymore.

> [@pyrex41](#):
>
> Where can I learn more about why the need for the escapes have been added to 0.6? Curious on the thought process here.

It’s a bug fix so that the behavior is actually consistent with the document now. It has always been a requirement to do this as described in the hygiene section I linked above (though it may not make a difference in global scope) but the implementation was wrong when you are calling the macro in the same module it was defined. Argueably the doc organization might have also encouraged people to use it incorrectly since it gaves multiple wrong example before introducing hygiene. I’m not really sure how to improve it though…

---

_[View the full topic](https://discourse.julialang.org/t/using-gensym-properly/3257)._
