I want to declare two structures, one of which contains many of the same elements of the other. In a simple example, it would be, for example:
struct A a :: Int64 end struct B a :: Int64 b :: Float64 end
What I am aiming is to be able to write something like (the following example does not work, but probably makes the point):
DataA = "a :: Int64" struct A eval(DataA) end struct B eval(DataA) b :: Int64 end
Of course, this would be used in a situation where the DataA is a long list of properties.
The same sort of construct could be used to define two structures with the same data structure, one mutable and the other not, for instance:
DataA = "a :: Int64" struct A eval(DataA) end mutable struct MutA eval(DataA) end
Actually I would like to do that to organize some data reading code, by reading the data first to a mutable structure and then passing it to an unmutable one.
I searched the docs for metaprograming options, but I could not find out how to make that work.
Thanks for the thoughts.