On 2009-10-16 11:49:12 +0200, Walter Bright <[email protected]> said:
Don wrote:
There are two sensible options:
I see the question as, is T[new] a value type or a reference type? I
see it as a reference type, and so assignment should act like a
reference assignment, not a value assignment.
I also see T[new] as a reference type.
Unfortunately this precludes some optimizations like putting size and
capacity directly at the start of the allocated array, avoiding a
redirection to access data: The caller object would miss the changes if
the block is reallocated.
T[new] a;
T[new] b;
b.length=LongLength;
a.length=?
But as putting them at the start of the array might have an adverse
effect on optimizations that expect special alignment (vector
operations) maybe not everything is bad.
Fawzi