digitalmars.D.bugs - dmd v0.92 assert
- Regan Heath (20/20) Jun 22 2004 --[test.d]--
- Walter (2/2) Jun 26 2004 It's not valid to use an array initializer in an expression; a correct
- Regan Heath (9/11) Jun 26 2004 What is the correct way to re-initialise an array?
- Regan Heath (10/19) Jun 26 2004 Or maybe
- Walter (5/31) Jun 27 2004 The way right now to do it is create a static version of the array
- Regan Heath (6/46) Jun 27 2004 Ok, so what is the point of the arrays' .init property then?
- Walter (4/9) Jun 27 2004 It actually gives you a null value, because that is the default initiali...
- Regan Heath (18/29) Jun 27 2004 Aha! I thought so, so.. why not turn this:
--[test.d]-- struct A { uint c[5] = [ 0, 1, 2, 3, 4 ]; void reset() { c = c.init; } } D:\D\src\build>dmd test.d Assertion failure: '0' on line 263 in file 'init.c' abnormal program termination Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 22 2004
It's not valid to use an array initializer in an expression; a correct message is now issued.
Jun 26 2004
On Sat, 26 Jun 2004 13:09:18 -0700, Walter <newshound digitalmars.com> wrote:It's not valid to use an array initializer in an expression; a correct message is now issued.What is the correct way to re-initialise an array? uint c[5] = [0,1,2,3,4]; c[] = c.init; ? Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 26 2004
On Sun, 27 Jun 2004 17:16:43 +1200, Regan Heath <regan netwin.co.nz> wrote:On Sat, 26 Jun 2004 13:09:18 -0700, Walter <newshound digitalmars.com> wrote:Or maybe foreach(inout uint u; c) u = u.init; if so, it would be nice if there was a shorthand way, like c[] = c[].init or something. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/It's not valid to use an array initializer in an expression; a correct message is now issued.What is the correct way to re-initialise an array? uint c[5] = [0,1,2,3,4]; c[] = c.init; ? Regan
Jun 26 2004
The way right now to do it is create a static version of the array initializer, then copy it into the arrays you want to reset. "Regan Heath" <regan netwin.co.nz> wrote in message news:opr98mp6mv5a2sq9 digitalmars.com...On Sun, 27 Jun 2004 17:16:43 +1200, Regan Heath <regan netwin.co.nz>wrote:On Sat, 26 Jun 2004 13:09:18 -0700, Walter <newshound digitalmars.com> wrote:Or maybe foreach(inout uint u; c) u = u.init; if so, it would be nice if there was a shorthand way, like c[] = c[].init or something. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/It's not valid to use an array initializer in an expression; a correct message is now issued.What is the correct way to re-initialise an array? uint c[5] = [0,1,2,3,4]; c[] = c.init; ? Regan
Jun 27 2004
On Sun, 27 Jun 2004 11:13:24 -0700, Walter <newshound digitalmars.com> wrote:The way right now to do it is create a static version of the array initializer, then copy it into the arrays you want to reset.Ok, so what is the point of the arrays' .init property then? Regan"Regan Heath" <regan netwin.co.nz> wrote in message news:opr98mp6mv5a2sq9 digitalmars.com...-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/On Sun, 27 Jun 2004 17:16:43 +1200, Regan Heath <regan netwin.co.nz>wrote:On Sat, 26 Jun 2004 13:09:18 -0700, Walter <newshound digitalmars.com> wrote:correctIt's not valid to use an array initializer in an expression; aOr maybe foreach(inout uint u; c) u = u.init; if so, it would be nice if there was a shorthand way, like c[] = c[].init or something. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/message is now issued.What is the correct way to re-initialise an array? uint c[5] = [0,1,2,3,4]; c[] = c.init; ? Regan
Jun 27 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr99vd3pd5a2sq9 digitalmars.com...On Sun, 27 Jun 2004 11:13:24 -0700, Walter <newshound digitalmars.com> wrote:It actually gives you a null value, because that is the default initializer for [] arrays.The way right now to do it is create a static version of the array initializer, then copy it into the arrays you want to reset.Ok, so what is the point of the arrays' .init property then?
Jun 27 2004
On Sun, 27 Jun 2004 21:15:10 -0700, Walter <newshound digitalmars.com> wrote:"Regan Heath" <regan netwin.co.nz> wrote in message news:opr99vd3pd5a2sq9 digitalmars.com...Aha! I thought so, so.. why not turn this: uint[5] c = [0,1,2,3,4]; into 2 arrays, 1 array 'c', and 1 static array which is assigned to the c's init property (instead of null), so that: c = c.init; will then re-initialise the array. For this: uint[] c; init would remain null and c = c.init; would be identical to c = null; which works doesn't it? Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/On Sun, 27 Jun 2004 11:13:24 -0700, Walter <newshound digitalmars.com> wrote:It actually gives you a null value, because that is the default initializer for [] arrays.The way right now to do it is create a static version of the array initializer, then copy it into the arrays you want to reset.Ok, so what is the point of the arrays' .init property then?
Jun 27 2004