Domenic Denicola wrote:
Why do arrow functions require a parameter list and a body? That is, none of
the following are allowed:
- `=> foo`
- `bar =>`
- `=>`
Instead you need the more-verbose
- `() => foo`
- `bar => {}`
- `() => {}`
Any chance of relaxing this a bit?
I proposed arrow functions and championed them into ES6. As the strawman
history shows, eliding () and {} were both supported at first:
http://wiki.ecmascript.org/doku.php?id=strawman:arrow_function_syntax&rev=1332877190
Note the _opt suffixes in the productions.
Meeting notes at
https://mail.mozilla.org/pipermail/es-discuss/2012-March/021872.html
don't cover the cuts, but es-discuss threads do:
https://mail.mozilla.org/pipermail/es-discuss/2012-April/022178.html
It really was a gestalt negative reaction. The grammar issues can be
dealt with. People just objected on the basis of (=>) or (=>42) being
too cryptic, IIRC. In the interest of gaining consensus, I cut the
controversial bits.
Now on to Oliver's followup, which may give more detail.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss