Marius Gundersen (2013-12-12T11:56:47.000Z)
Couldn't a slight variation be used for arrow functions, rather than adding
yet another character in front or behind it? For example, using -> or ~>
(unless they have been reserved for something in ES7):

var arrowFunction = (a, b) => a+b;
var generator = (a, b) -> yield a; yield b;
var async = (a, b) ~> (await a) + (await b);

Marius Gundersen


On Thu, Dec 12, 2013 at 11:49 AM, Forbes Lindesay <forbes at lindesay.co.uk>wrote:

> I always want the * to be mandatory for full generator functions as a
> visual cue.  I suspect I would want something similar for async functions
> but I can see logic to not needing the same visual cue on an arrow function.
>
> Arrow functions would often be significantly shorter, so the visual cue of
> the `yield`/`await` keyword would be more obvious.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131212/2dc6d740/attachment.html>
forbes at lindesay.co.uk (2013-12-16T14:34:27.278Z)
Couldn't a slight variation be used for arrow functions, rather than adding
yet another character in front or behind it? For example, using `->` or `~>`
(unless they have been reserved for something in ES7):

```js
var arrowFunction = (a, b) => a+b;

var generator = (a, b) -> yield a; yield b;

var async = (a, b) ~> (await a) + (await b);
```
forbes at lindesay.co.uk (2013-12-16T14:33:59.179Z)
Couldn't a slight variation be used for arrow functions, rather than adding
yet another character in front or behind it? For example, using -> or ~>
(unless they have been reserved for something in ES7):

```js
var arrowFunction = (a, b) => a+b;

var generator = (a, b) -> yield a; yield b;

var async = (a, b) ~> (await a) + (await b);
```