Maybe you already know this, but macros are applied at parsing time (or 
right after parsing - not sure). This means that if you have

# In Macro.jl
macro macmac(x)
...
end

# In Fun.jl
function foo(x)
   macmac(something)
end
 

Then whenever you've changed Macro.jl, you need to reload both Macro.jl and 
Fun.jl, because as far as Julia is concerned, `macmac(something)` isn't "a 
reference to the macmac macro"; once Fun.jl has been loaded, `macmac` is 
completely gone from foo's definition, and replaced with its macroexpansion.

Doing that, I've never had any issue with reloading macros. Do you have 
another problem in mind, or more specific code?

On Monday, May 23, 2016 at 5:31:37 PM UTC-4, [email protected] wrote:
>
> First, thanks to Matt Baumann for answering my previous post so quickly!
>
> Next question: it seems that for developing and debugging a macro, the 
> usual REPL cycle of edit/include/edit/include does not work.,  I find that 
> using 'include' to reload the macro definition defined inside a module does 
> not overwrite its previous definition.  It seems that to replace a macro 
> definition, I need to exit the REPL and start a new REPL.  Is there some 
> other way?
>
> Thanks,
> Steve Vavasis
>
>

Reply via email to