Copying struct fields to another struct

question
#1

For example I have an -

abstract type A

abstract type B <: A

struct C <: B
fields
end

Now, I want another struct D which has all fields of C but is a subtype of A i.e,

struct D <: A
C fields
end

Is there a way to do this, without manually copy pasting the contents ?

0 Likes

#2

No, at least not without macros. Copy and paste is honorable.

2 Likes

#3

Is Mixers.jl what you want? And what about Classes.jl?

0 Likes