# Returning a module expression from a macro to be evaluated at a different module

**URL:** <https://discourse.julialang.org/t/returning-a-module-expression-from-a-macro-to-be-evaluated-at-a-different-module/11738>\
**Category:** General Usage\
**Created:** [June 17, 2018, 10:24pm UTC](https://discourse.julialang.org/t/returning-a-module-expression-from-a-macro-to-be-evaluated-at-a-different-module/11738 "2018-06-17T22:24:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [June 18, 2018, 7:27am UTC](https://discourse.julialang.org/t/returning-a-module-expression-from-a-macro-to-be-evaluated-at-a-different-module/11738/2 "2018-06-18T07:27:07Z")

</div>

You can’t do that. A macro cannot do more than you could by typing code. And you cannot define a module in `Y` and expect it to be in `X`. You could `eval` into any other module, as you found out in the [other thread](https://discourse.julialang.org/t/how-to-define-a-function-in-a-different-module-other-than-what-you-are-in-right-now/11736). But as stated there, that is bad style. I’m pretty sure that there is another solution to you problem though…

---

_[View the full topic](https://discourse.julialang.org/t/returning-a-module-expression-from-a-macro-to-be-evaluated-at-a-different-module/11738)._
