At first I was like, what a simple question... then I started to explain it I 
was like whaaaaa

You can think of it as shallowCopy with some extra.

  * a/b are objects - shallowCopy of the struct including packed objects (which 
might appear like deepCopy).
  * a/b are ref objects - shallowCopy only the ref is copied.
  * a/b are strings or sequences - shallowCopy only the size and the array is 
copied (which might appear like deepCopy but first layer of the array is not 
deep, might appear like deepCopy for non refs)
  * a/b is everything else (int - for example) - shallowCopy



Or you can think of it as deepCopy till you get a nim ref or a nim pointer, 
then just the pointer is copied.

  * a/b are objects - deepCopy till you get a nim ref or a nim pointer
  * a/b are ref objects - shallowCopy only the ref is copied.
  * a/b are strings or sequences - deepCopy till you get a nim ref or a nim 
pointer (note internal C pointer to array data does not count as a "nim 
pointer")
  * a/b is everything else (int - for example) - deepCopy that's kind of like 
shallowCopy as it does not matter for leaf objects.


Reply via email to