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
+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
...@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
= =) {
// ...
}
```
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
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
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
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
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
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
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
- `= 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
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
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
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 = {}`
- `() =
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
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
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
17 matches
Mail list logo