T[new] misgivings
Steven Schveighoffer
schveiguy at yahoo.com
Tue Oct 20 05:38:19 PDT 2009
On Fri, 16 Oct 2009 05:49:12 -0400, Walter Bright
<newshound1 at digitalmars.com> wrote:
> 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.
Andrei says you think arrays are like slices with some extra
functionality, but slices are *not* a reference type, they are hybrids.
Do you think T[new] arrays should be fully reference types? (I do)
Otherwise, if you keep the "length is a value type" semantic, you get the
same crappy appending behavior we have now.
-Steve
More information about the Digitalmars-d
mailing list