I've tried this:
a = Array.new(3,) => [, , ]
a.push(3) => [,,]
Is this correct? a.push(3) is the same as a.push(3)? If the
constructor creates the same copy for all array elements, shouldn’t the
array create copies when writing?
I’m not sure I follow the question, but the general thing going on is:
a and a and a are references to the same object, so if you
change the object through one of those references, the change will be
visible in all of them.
It’s as if you said:
ar = 
a = [ ar, ar, ar ]
and then ‘a’ would look like: [,,]
On Wed, 14 Aug 2002, Maurício wrote:
David Alan Black