RE: More concise arrow functions

2013-07-27 Thread Nathan Wall
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? +1

Re: More concise arrow functions

2013-07-27 Thread Axel Rauschmayer
+1 My perspective: I don’t see a use case for a missing body, but a missing parameter list would be very useful – to delay the execution of a block of code. It also makes much sense visually: 2. (x, y) = { ... } 1. x = { ... } 0. = { ... } On Jul 26, 2013, at 22:11 , Brandon Benvie

RE: More concise arrow functions

2013-07-27 Thread Domenic Denicola
...@rauschma.de Sent: ‎7/‎28/‎2013 0:40 To: Brandon Benviemailto:bben...@mozilla.com Cc: es-discuss@mozilla.orgmailto:es-discuss@mozilla.org Subject: Re: More concise arrow functions +1 My perspective: I don’t see a use case for a missing body, but a missing parameter list would be very useful – to delay

Re: More concise arrow functions

2013-07-27 Thread Axel Rauschmayer
= =) { // ... } ``` From: Axel Rauschmayer Sent: ‎7/‎28/‎2013 0:40 To: Brandon Benvie Cc: es-discuss@mozilla.org Subject: Re: More concise arrow functions +1 My perspective: I don’t see a use case for a missing body, but a missing parameter list would be very useful – to delay the execution of a block

Re: More concise arrow functions

2013-07-26 Thread Oliver Hunt
On Jul 26, 2013, at 8:50 AM, Domenic Denicola dome...@domenicdenicola.com wrote: Why do arrow functions require a parameter list and a body? That is, none of the following are allowed: - `= foo` I guess this could be lexically unambiguous, but i'm unconvinced that the win of losing two

RE: More concise arrow functions

2013-07-26 Thread Domenic Denicola
From: Oliver Hunt [oli...@apple.com] I guess this could be lexically unambiguous, but i'm unconvinced that the win of losing two characters in the strictly less common no parameters is worth the syntactic confusion No-parameter functions are pretty darn common, especially if you count cases

Re: More concise arrow functions

2013-07-26 Thread Brendan Eich
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

Re: More concise arrow functions

2013-07-26 Thread Brendan Eich
Oliver Hunt wrote: On Jul 26, 2013, at 8:50 AM, Domenic Denicoladome...@domenicdenicola.com wrote: Why do arrow functions require a parameter list and a body? That is, none of the following are allowed: - `= foo` I guess this could be lexically unambiguous, but i'm unconvinced that the

RE: More concise arrow functions

2013-07-26 Thread Domenic Denicola
From: Brendan Eich [bren...@mozilla.com] I proposed arrow functions and championed them into ES6. As the strawman history shows, eliding () and {} were both supported at first: Right, I remember `{}` being optional at least; in fact the genesis of this thread was me working with Traceur this

Re: More concise arrow functions

2013-07-26 Thread Brendan Eich
Domenic Denicola wrote: From: Brendan Eich [bren...@mozilla.com] I proposed arrow functions and championed them into ES6. As the strawman history shows, eliding () and {} were both supported at first: Right, I remember `{}` being optional at least; in fact the genesis of this thread was me

Re: More concise arrow functions

2013-07-26 Thread Kevin Smith
- `= foo` None of the others, but this variant would be nice from a purely aesthetic point of view. There's something vaguely visually unappealing about the empty parens followed by the arrow. { Kevin } ___ es-discuss mailing list

Re: More concise arrow functions

2013-07-26 Thread Brendan Eich
Arguing with myself... Brendan Eich wrote: Optional parameter list is an easier sell since = is very unlikely to start a statement, while = may well end one may well is too strong. My example in reply to Oliver was var empty = = callLater(empty, sorry); But it's hard to think of

Re: More concise arrow functions

2013-07-26 Thread Matthew Robb
Honestly I would prefer that the parens be mandatory all the time, right now it's just confusing to explain when it has so many variations. On Fri, Jul 26, 2013 at 10:35 AM, Brendan Eich bren...@mozilla.com wrote: Arguing with myself... Brendan Eich wrote: Optional parameter list is an

Re: More concise arrow functions

2013-07-26 Thread Michael Haufe
On Fri, Jul 26, 2013 at 10:50 AM, Domenic Denicola dome...@domenicdenicola.com 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 = {}` - `() =

Re: More concise arrow functions

2013-07-26 Thread Quildreen Motta
One company I advise tried it, and found that its unsyntax bit back in this way: code that compiled and seemed to do one thing did something quite different. This happens with JS due to ASI; it also happens just due to the C syntax heritage. But it happens more often with CoffeeScript, from

Re: More concise arrow functions

2013-07-26 Thread Brandon Benvie
On 7/26/2013 11:53 AM, Michael Haufe wrote: A useless parameter is an option: _= 'foo' This seems to be an argument in favor of making the params completely optional. The fact that throwing in a useless param is more concise than having zero params (due to paranthesis requirement). I

Re: More concise arrow functions

2013-07-26 Thread Brendan Eich
I'll put it on the agenda for the September TC39 meeting. /be Brandon Benvie wrote: I think the semicolon hazard is enough to make omitting the body questionable, but omitting the params is an easy win with no downside. ___ es-discuss mailing