3

Given tow seqs, a and b, declared like this:

var
  a = @[1, 2, 3]
  b = @[4, 5, 6]

will a = b create a new seq copying everything from b to a or, reuse a? I have problems specially regarding to shallowCopy. I cannot tell what are they doing different.

Arrrrrrr
  • 802
  • 6
  • 13
  • 1
    By using `repr` you can see that `a` points to a new address after the assignment, so it is a new copy. But you are right, I also see a new address when taking a `shallowCopy` in this example, And the new address is _not_ the address of `b`, which one might expect. – bluenote10 Aug 26 '15 at 14:44

1 Answers1

2

The short answer is mostly yes.

The long answer is that sequence assignment is handled by the procs, appearing in the assign module, which is part of the system module. You can search this file for tySequence to see the relevant code.

zah
  • 5,314
  • 1
  • 34
  • 31