[Nickle] Growable arrays, sort of

Barton C Massey bart at cs.pdx.edu
Sun Jun 29 15:19:05 PDT 2003


It appears that a start at growable arrays are there, but
borken.

  $ nickle
  > int[*] a;
  > a[0] = 0;
  Unhandled exception uninitialized_value ("Uninitialized value")
  <stdin>:2:     a[0] = 0;
  > int[] a;
  > a[0] = 0;
  Unhandled exception uninitialized_value ("Uninitialized value")
  <stdin>:4:     a[0] = 0;

Were int[*] and int[] supposed to be synonyms?  I had
thought not: one of them should allocate a zero-length
growable array?

  > int[0] a;
  > a[0] = 0
  0
  > dim(a)
  1
  > a[1] = 0;
  > dim(a)
  2
  > a[2] = 0;
  > dim(a)
  4
  >

Need dim() to return the right thing.  An alternate name for
the actual size would be fine...

	Bart



More information about the Nickle mailing list