[Nickle]initializer bug?

Bart Massey nickle@nickle.org
Wed, 28 Aug 2002 21:41:22 -0700


Attached is a code fragment initializing an array of
structures containing an array: the initializer doesn't
work.  Is this a bug in my code, or in Nickle?  I suspect
the latter.  (Additionally, why should Nickle need the
"(cell)" in the initializer?  It seems like it should be
able to infer this from the lhs type, as does C, but it
seems to get even more lost without it.)

Thanks,

	Bart

  /*
   * Ricochet Robots solver
   * Bart Massey 2002/8
   */

  int size = 16;

  typedef enum {
      BLANK, ME, DRONE, TARGET
  } cellval;

  typedef struct {
      cellval val;
      /* 0 == N, 1 == E, 2 == S, 3 == W */
      bool[4] wall;
  } cell;

  cell[size, size] cells = {
      {(cell){val = cellval.BLANK,  wall = {false ...}} ...}
      ...
  };