macro makefn(name)
name = Symbol(name)
quote
$(esc(name))() = print("hello")
end
end
julia> @makefn f
f (generic function with 1 method)
julia> f()
hello
julia> @code_string f()
" \$(esc(name))() = println(\"hello\")"
In an ideal world, @code_string f() would return something like f() = println(\"hello\")".