The input expression needs to be specified for the macro, because the macro returns the expression that is evaluated, while you want to get the expression itself, so you need additional quoting. Quoting can be done as:
macro mymacro(ex)
Expr(:quote,ex)
end
e=@mymacro x + 2
source
share