Is there a def macro analogue in julia?
# Macro for inserting fields
macro def(name, definition)
@def my_fields begin
mutable struct MyStruct
You could use CompositeStructs.jl:
@composite mutable struct MyStruct
In this case
MyFields is also a struct, if you want to make sure no one can make an instance of
MyFields and it serves only as a list of fields, you could also add an inner constructor
MyFields() = error().