Re: [julia-users] inserting an Expr into AST via macro

2015-03-18 Thread Abe Schneider
Thank you for the link. However, I am familiar with interpolation. What I don't understand is how you change `test2` in order to use it. Because there's no quote directly in that macro, Julia will complain about using '$' in a non-quoted expression. On Wednesday, March 18, 2015 at 8:37:25 AM

[julia-users] inserting an Expr into AST via macro

2015-03-18 Thread Abe Schneider
If I do something simple like: macro test() :(parsefloat(3.1459)) end @test() # 3.1459 everything works as expected. However, if I try this instead: macro test2(ex) ex end @test2(:(parsefloat(3.1459))) # :(parsefloat(3.1459)) Not what I expected, but it makes sense what's happening:

Re: [julia-users] inserting an Expr into AST via macro

2015-03-18 Thread Isaiah Norton
See http://docs.julialang.org/en/release-0.3/manual/metaprogramming/#interpolation On Mar 18, 2015 8:08 AM, Abe Schneider abe.schnei...@gmail.com wrote: If I do something simple like: macro test() :(parsefloat(3.1459)) end @test() # 3.1459 everything works as expected. However, if I