With this macro:

macro test(fun)
  @printf "%s\n" string(fun)
end

these three expressions print as follows:

@test(sin)
# sin
@test(x -> sin(x))
# x->begin  # /***.jl, line 84:
#        sin(x)
#    end
@printf "%s\n" string(x -> sin(x))
# (anonymous function)

How do I get the string "(anonymous function)" inside a macro with the 
string function? It keeps expanding fun to the whole function expression, 
which I don't want to print in full.

Reply via email to