![](https://secure.gravatar.com/avatar/fa5a8de5c6e6c5838fc8106b390c7a6d.jpg?s=120&d=mm&r=g)
Dear list, //this is fine fun int[] foo() { return [1, 2, 5]; } //this isn't fun int[] bar() { return []; } ChucK and me disagree here. I'm of the opinion that "[]" is a perfectly fine array of integers (albeit of length 0) and hence correct. ChucK is of the opinion that there's a syntax error.I suppose the issue is in "[]" not having a explicid type but I said what the type was going to be up-front. In fact the only way of defining a array of length 0 seems to be this; int empty_int_array[0]; //and while we're at it float empty_float_array[0]; //etc I find that less then elegant. Yours, Kas.
![](https://secure.gravatar.com/avatar/e31c7480e296bd78e00f7d9e88e38693.jpg?s=120&d=mm&r=g)
Hi Kassen! Good catch! Enqueuing on BUG/TODO list, pending syntactic due diligence checking... Thanks!! Best, Ge! On Sun, 22 Jun 2008, Kassen wrote:
Dear list,
//this is fine fun int[] foo() { return [1, 2, 5]; }
//this isn't fun int[] bar() { return []; }
ChucK and me disagree here. I'm of the opinion that "[]" is a perfectly fine array of integers (albeit of length 0) and hence correct. ChucK is of the opinion that there's a syntax error.I suppose the issue is in "[]" not having a explicid type but I said what the type was going to be up-front. In fact the only way of defining a array of length 0 seems to be this;
int empty_int_array[0]; //and while we're at it float empty_float_array[0]; //etc
I find that less then elegant.
Yours, Kas.
participants (2)
-
Ge Wang
-
Kassen