How to get the name of the current function

You have an interpolation problem, trying to interpolate into a string and into @eval at the same time. Try this instead:

for fname in (:foo, :bar)
    @eval $fname() = string("This function is `", $fname, "`")
end
3 Likes