julia> macro doit(T)
fnames = fieldnames(eval(T))
# better:
# fieldnames(Core.eval(__module__, T))
@show fnames
end
@doit (macro with 1 method)
julia> struct S;a;b;end
julia> @doit S
fnames = (:a, :b)
(:a, :b)
2 Likes