An array destructing specification choice
David Herman
dherman at mozilla.com
Fri Nov 11 17:44:47 PST 2011
On Nov 11, 2011, at 5:31 PM, Axel Rauschmayer wrote:
>> Also: we'll definitely want to allow it for splicing, so the grammar will have to allow it already, and symmetry/consistency argue for allowing it in destructuring too. Likewise for function formals and actuals.
>
>
> Using it for splicing suggests a construction analog:
>
> let r = [2,3,4]
> let arr = [0,1,..r, 5, 6, 7]
That's what I meant by splicing.
> The grammar seems to support this, but I’ve never seen it in an example.
>
> I might also be useful in parameter lists:
>
> function foo(first, ...middle, last) {
> }
That's what I meant by function formals and actuals.
Dave
More information about the es-discuss
mailing list