Based on a question I saw on IRC, it appears that the way values are allocated 
to parameters differs between two cases, where one case is calling a function, 
and the other is an "inline" assignment.

In other words, comparing these two different cases:

        def foo(Object a, Object[] b) { println("a[${a}] b[${b}]") }

And calling it with:

        foo(1, 2, 3, 4)

And the following case:

        def (int a, int[] b) = [1, 2, 3, 4]                   // Given this ...
        println("a[$a] b[$b]")

Putting this all into a script, this outputs this:

        a[1] b[[2, 3, 4]]
        a[1] b[[2]]

Apparently, the ability to allocate the "rest" of the values to a trailing 
array parameter works fine for function parameters, but for the other case 
(what would you call that?), it just puts the first value into the array.

Reply via email to