On 01.04.2011 18:37, Sean Eagan wrote:
Why not allow the spread operator to appear earlier (still just once though) in ArrayPatternList in http://wiki.ecmascript.org/doku.php?id=harmony:destructuring? This could be useful when there is interesting stuff at the end and not interesting and/or variable length stuff earlier// variable length early segment function(first, ...variableLength, last){} // not interesting early segment function(interesting, ...notInteresting, alsoInteresting){} // identifier omission may be useful in this case function(interesting, ..., alsoInteresting){} // array literal forms [first, ...variableLength, last] = arr; [interesting, ...notInteresting, alsoInteresting] = arr; [interesting, ..., alsoInteresting] = arr;
Yeah, I think we need it (at least if to make the destructuting feature, then to make it completely). CoffeeScript has such a middle-destructuring feature also: http://jashkenas.github.com/coffee-script/#destructuring
Dmitry.
Thanks, Sean Eagan _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

