Generator Arrow Functions

Brendan Eich brendan at mozilla.com
Mon Nov 18 10:38:22 PST 2013


Ѓорѓи Ќосев wrote:
> Its harder to scan whether this is a generator arrow function or a 
> normal arrow function because the star is too far away:
>
>     someFunction(*(someArgument, anotherArgument) => {
>         ... code ...
>     });
>
> compared to this form, where its immediately obvious that this is not 
> a regular function, just by looking at the composed symbol (arrow-star)
>
>     someFunction((someArgument, anotherArgument) =>* {
>         ... code ...
>     });

I buy it. This is what I'll propose next week as concrete syntax. It's a 
small point, but the rationale is "the star goes after the first token 
that identifies the special form as a function form." For generator 
functions, that token is 'function'. For arrows, it is '=>'.

/be


More information about the es-discuss mailing list