This is probably not applicable to what you are trying to do, but maybe you 
want to use a reference instead?
    
    
    type Person = ref object
      first, last: string
    
    let person1 = Person(first: "John", last: "Doe") # calls `new` implicitly 
for ref types
    echo person1.first, " ", person1.last
    
    let person2 = person1
    echo person1 == person2 # true
    

that's now heap allocated and gives you a pointer traced by the GC.

`=` merely copies that pointer and does not create a new instance.

new instances can only be created with `new` or the object constructor.

Reply via email to