improve @defstruct macro to add copy constructor