A module has an enum type
A and I want to export all its instances
I want to write a macro
module MyModule export A @enum A a b c @export_instances A # `export a, b, c` end # module
I have read Julia documentation’s metaprogramming page and Export enum - #4 by mathieu17g. I was able to implement the following function to return the expression to export all instances of an enum type
function export_instances(T) :(export $(Symbol.(instances(T))...)) end
Then, I have tried to write the desired macro but can’t. How do I?