February 06, 2004
dmd 0.79, WIN98SE

void main(){
  static int[]  bar=[0,,,3];

  printf("%d\n", bar[1]);
}

this compiles and outputs `3'.

So long.
February 06, 2004
Manfred Nowak wrote:

>dmd 0.79, WIN98SE
>
>void main(){
>  static int[]  bar=[0,,,3];
>
>  printf("%d\n", bar[1]);
>}
>
>this compiles and outputs `3'.
>
>So long.
>  
>

This is to do with empty comma operators being ignored.  If you did

void main()
{
 static int[]  bar=[0,,,3];

 printf("%d\n", bar.length);
}

you would get 2.  The parhaps the code should cause a compilation error (or initialize emptys with the default (ie constructor)).

-- 
-Anderson: http://badmama.com.au/~anderson/