[chuck-users] nameless empty arrays

Ge Wang ge at ccrma.Stanford.EDU
Sun Jun 22 00:59:55 EDT 2008


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.
>


More information about the chuck-users mailing list