Update, it seems like the unquote expressions are actually correct, in that they evaluate to the right thing.
However, that's some ugly printing. If I write :(:($x)) why does it look so messy? Why can't the printer outptut :(:($x)) as the representation of itself? This seems contrary to many other julia expression objects, which get printed out in a human readable fashion. On Saturday, January 16, 2016 at 11:50:05 PM UTC-8, [email protected] wrote: > > Hi! > > Was messing around with exceptions, and trying to see under the hood and > construct macro expressions. > > Eg, Meta.show_sexpr(:(:(+ 1 2))) -> (:quote, (:call, :+, 1, 2)) > > but how do you build an unquote expression? > > Meta.show_sexpr(:(:($(x+5) + 1))) -> (:quote, (:call, :+, (:$, (:call, :+, > :x, 5)), 1)) > > > But Expr(:quote, Expr(:call, :+, Expr(:$, Expr(:call, :+, :x, 5)), 1)) -> > :($(Expr(:quote, :($(Expr(:$, :(x + 5))) + 1)))) > > In other words, it's not processing into the appropriate expression, and > there's some weird intermediate syntax going on. > > > How does one build an unquote expression? I.e, an expression that would > eval to unquoting a variable? >
