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.