I've been doing several experiments on the matter and read a lot, but to make sure II got it right, I would be grateful if I had your input.
So...
What is the difference between:
when:
I think for most of us it works exactly as we suppose.
Some years ago there was no exact documentation available, so indeed you request writing documentation. But I think explaining this is not that easy, as it should be understandable to newcomers, but at the same time not boring for experts. Maybe you can try yourself, and araq or mratsim can correct it. But maybe we need two version, the short for the manual, and the longer one for a beginner book.
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.
Or you can think of it as deepCopy till you get a nim ref or a nim pointer, then just the pointer is copied.
Value semantics means that the copy owns its memory and lives separately from the copied.
Reference semantics means that the copy and the copied refer to the same underlying memory location.
Now:
Now you might want to now why shallowCopy actually deep copies, well that's because they are values they don't refer to any memory location so you can't just copy the reference.