Julia: How do I create a macro that returns its argument? -
my question quite similar this one , difference. want create macro (or whatever) behaves way: julia> @my-macro x + 2 :(x + 2) (note x + 2 not enclosed in quotes). there in julia? , if there not, how do it? (please, give detailed explanation why works.) the input expression macro needs quoted because macro returns expression, evaluated, while expression itself, hence need quoting. quoting can done as: macro mymacro(ex) expr(:quote,ex) # creates expression looks :(:(x + 2)) end e=@mymacro x + 2 #returns :(x + 2)