[Nickle] Re: Another nickle question

Barton C Massey bart at cs.pdx.edu
Sat Nov 13 20:47:30 PST 2004


Couple of possible gotchas.  First, make sure you're using
sufficiently recent Nickle bits: we fixed some bugs a month
or so back.  Second, note that as they are currently
implemented, growable arrays aren't allocated until they're
initialized.  This is a bug, and should be fixed.  Finally,
note that until you've initialized a cell in the array, you
can't initialize its contents.

Here's some Nickle that works
  $ nickle
  > typedef struct { int x; } s;
  > s[...] a = {};
  > a[0] = (s){x=3};
  > setdim(a,2)
  > a
  (s [...]) {{x = 3}, <uninit>}
  > setdim(a,0)
  > 

	Bart

In message <Pine.GSO.4.58.0411131444580.19710 at atlas.cs.pdx.edu> you wrote:
> 	I am trying to use the '...' to declare resizeable arrays, but I
> keep getting this exception:
> Unhandled exception uninitialized_value ("Uninitialized value")
> when ever I try to assign into the array I declared.
> 	Also I can't seem to find any documentation on setdim and setdims.
> When I try to use setdim with my resizable array, I also get the same
> exception.
> 	I declare the array with "location[...] bases" and call setdim
> with "setdim(bases,10)".



More information about the Nickle mailing list