The macro alias is good, but the way you call it is not, instead like this:

julia> eval(Expr(:macrocall, symbol("@m"), :(1+2)))
Expr
  head: Symbol call
  args: Array(Any,(3,))
    1: Symbol +
    2: Int64 1
    3: Int64 2
  typ: Any

Also please do submit a bug report as the crash error indicates, with as 
much info as you can. even when you should get an error you shouldn't get a 
segmentation fault.

* https://github.com/JuliaLang/julia/issues


El martes, 2 de febrero de 2016, 0:32:34 (UTC-6), Leonardo escribió:
>
> Hello,
> I'm looking for a way to create a macro aliases (at now, without success)
>
> I've defined simple macro:
> macro m(ex)
>   dump(ex)
> end
>
> and command 
> dump(:(@m(1+2)))
> returns:
> Expr
>   head: Symbol macrocall
>   args: Array(Any,(2,))
>     1: Symbol @m
>     2: Expr
>       head: Symbol call
>       args: Array(Any,(3,))
>         1: Symbol +
>         2: Int64 1
>         3: Int64 2
>       typ: Any
>   typ: Any
>
> then I've simulated a call to macro m with:
> eval(Expr(:macrocall,[symbol("@m"),:(1+2)]))
>
> but this cause a crash of REPL:
> Please submit a bug report with steps to reproduce this fault, and any 
> error mes
> sages that follow (in their entirety). Thanks.
> Exception: EXCEPTION_ACCESS_VIOLATION at 0x82792b10 -- unknown function 
> (ip: 000
> 0000082792B10)
> unknown function (ip: 0000000082792B10)
> (I use Julia 0.4.3 under Win64 platform)
>
> BTW, if anyone can suggest me how to define a macro alias ...
>
> Many thanks
>
> Leonardo
>
>

Reply via email to