[Nickle] global

Bart Massey nickle@nickle.org
Thu, 29 May 2003 01:34:57 -0700


Looks like global isn't working right?

  $ nickle
  > for(int i = 0; i < 2; i++) {
  +   global int[2] x = { 1, (printf("init\n"), 2) };
  + }
  init
  init
  >

Replacing global with static results in

  $ nickle
  > for(int i = 0; i < 2; i++) {
  +   static int[2] x = { 1, (printf("init\n"), 2) };
  + }
  <stdin>:2: Invalid storage class static

Do I misunderstand lifetimes somehow?

	Bart