[Nickle] Nickle bug/misfeature: storage for growable arrays of growable arrays

Bart Massey nickle at po8.org
Sat Jan 15 00:47:43 PST 2005

Nickle has a nice feature wrt arrays: storage is
auto-allocated.  For growable arrays, this means that
this works

    > int[...] x;
    > &int xr = &x[0]
    > xr = 3
    > x
    (int [...]) {3}

But now consider the sad case of growable arrays of growable

    > int[...][...] x;
    > &int[...] xr = &x[0]
    > &int xrr = &xr[0]
    Unhandled exception uninitialized_value ("Uninitialized value")
    <stdin>:3:     &int xrr = &xr[0]

The elements of the subarray appear not to be initialized on
demand as expected.

Am I missing something?


More information about the Nickle mailing list