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

Keith Packard keithp at keithp.com
Sun Jan 16 00:09:54 PST 2005


Around 20 o'clock on Jan 15, nickle at po8.org wrote:

> Just do the same thing with arrays you do with structs: let
>   int[...][...] a;
> be shorthand for
>   int[...][...] a = {{} ...};
> and the default value should take care of it, I think?

No, the problem is with:

	int[...][*] foo (int i) { return (int[...][i]) { { 1, ... } }; }
	a = foo (10);
	&int[*] b = &a[1];

At this point, I should have initialized a[1], but I no longer have any 
idea what size the array should be, even though the type declaration which 
created it makes the size quite evident.  The value for this array 
dimension is a local variable in foo scope...

With a single default value which is connected to the resizable array, 
this will be trivial.  I've gotten started on that, but it's a bit tricky 
as I have to semantically disambiguate between the default resizable array 
initializer and a repeated non-resizable array initializer.  There's no 
conflict; repeated initializers were not previous permitted for resiable 
arrays.

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : /pipermail/nickle/attachments/20050116/43c4bfda/attachment-0001.pgp


More information about the Nickle mailing list