Edit: In the category of “never mind…” , the example below does not accurately replicate the problem.
My apologies to those who took time to consider it.
Consider
macro x(expr)
dump(expr)
println("------")
dump(expr.args[1])
println("======")
expr.args[1] = :z
end
julia> @x y()
Expr
head: Symbol call
args: Array{Any}((1,))
1: Symbol y
typ: Any
------
Symbol y
======
UndefVarError: z not defined
Why is expr
evaluated when expr.args[1] = :z
?