On Sun, Sep 25, 2016 at 10:11 AM, Marius Millea wrote:
> Ahh nice, thanks. Your macrocall suggestions reads cleanly too, I think it'd
> look something like this:
>
> julia> macro macrocall(mac,args...)
>Expr(:macrocall,esc(mac),map(esc,args)...)
>end
>
Ahh nice, thanks. Your macrocall suggestions reads cleanly too, I think
it'd look something like this:
julia> macro macrocall(mac,args...)
Expr(:macrocall,esc(mac),map(esc,args)...)
end
@macrocall (macro with 1 method)
julia> @macrocall idmacro 1+2
3
What's the problem with
On Sun, Sep 25, 2016 at 7:25 AM, Marius Millea wrote:
> I can store a macro to a variable (let use the identity macro "id" as an
> example),
>
> julia> idmacro = macro id(ex)
>:($(esc(ex)))
>end
> @id (macro with 1 method)
>
>
> How can I use this macro
It you should return just esc(ex). It seems :($(esc(ex))) makes it an
expression wrapping an expression.
I can store a macro to a variable (let use the identity macro "id" as an
example),
julia> idmacro = macro id(ex)
:($(esc(ex)))
end
@id (macro with 1 method)
How can I use this macro now? I can *almost* do it by hand by passing an
expression as an argument and eval'ing the