Re: [julia-users] Macro hygiene issue

2016-03-02 Thread Cedric St-Jean
Thank you, that solved it. On Wed, Mar 2, 2016 at 10:54 AM, Yichao Yu wrote: > On Wed, Mar 2, 2016 at 10:51 AM, Cedric St-Jean > wrote: > > Hi, I have a situation that looks a bit like this: > > > > module A > > function foo end > > end > > > > module B > > import A: foo > > macro define_foo(ty

Re: [julia-users] Macro hygiene issue

2016-03-02 Thread Yichao Yu
On Wed, Mar 2, 2016 at 10:51 AM, Cedric St-Jean wrote: > Hi, I have a situation that looks a bit like this: > > module A > function foo end > end > > module B > import A: foo > macro define_foo(typ, value) > :(foo(::$(esc(typ))) = $(esc(value))) :(A.foo(...) = ...) > end > end > > module C > u

[julia-users] Macro hygiene issue

2016-03-02 Thread Cedric St-Jean
Hi, I have a situation that looks a bit like this: module A function foo end end module B import A: foo macro define_foo(typ, value) :(foo(::$(esc(typ))) = $(esc(value))) end end module C using B: @define_foo @define_foo Int 19 end A.foo(20) In other words, A is defining a function foo, B