On Wed, 12 Aug 2009 12:41:20 -0400, Ali Cehreli wrote:
Steven Schveighoffer Wrote:
> int[] a = [ 0, 1, 2 ];
> a[0] = 42;
No, it's a mutable array. It's one of the quirks of D2 that bugs me. A
string literal is an immutable array but a normal array literal actually
allocates new s
Steven Schveighoffer Wrote:
> > int[] a = [ 0, 1, 2 ];
> > a[0] = 42;
> No, it's a mutable array. It's one of the quirks of D2 that bugs me. A
> string literal is an immutable array but a normal array literal actually
> allocates new space on the heap for the array every time you us
On Tue, 11 Aug 2009 19:05:56 -0400, Ali Cehreli wrote:
Does the expression [ 0, 1, 2 ] form an immutable array? If so, is the
assignment to a[0] undefined below? Is it trying to modify an immutable
element?
int[] a = [ 0, 1, 2 ];
a[0] = 42;
The reason for my thinking that [ 0, 1,
Ali Cehreli wrote:
Does the expression [ 0, 1, 2 ] form an immutable array? If so, is the
assignment to a[0] undefined below? Is it trying to modify an immutable element?
int[] a = [ 0, 1, 2 ];
a[0] = 42;
The reason for my thinking that [ 0, 1, 2] is an array is because it has the
.du
Does the expression [ 0, 1, 2 ] form an immutable array? If so, is the
assignment to a[0] undefined below? Is it trying to modify an immutable element?
int[] a = [ 0, 1, 2 ];
a[0] = 42;
The reason for my thinking that [ 0, 1, 2] is an array is because it has the
.dup property and this w