Pseudo headless arrows
ultcombo at gmail.com
Thu Apr 21 22:33:48 UTC 2016
The `==>` token would look like a new operator, which developers would have
to look up in order to know exactly what it does. It is more confusing than
Also `==>x` has the same length as `_=>x`, the latter not introducing any
new syntax (although it does employ an ugly unused identifier).
By the way, this may be of interest to you: Headless Arrow Functions
On Thu, Apr 21, 2016 at 3:48 PM, Peter van der Zee <ecma at qfox.nl> wrote:
> <searched for it><excuses if>
> There are two ways of writing argument-less arrows;
> () => x;
> _ => x;
> (Where `_` can be any identifier, of course.) I understand why we
> can't drop the head entirely so if we're forced to type anything at
> all, anyways, why not at least make it simpler by pressing two
> different keys instead of three/four:
> ==> x;
> I don't believe this leads to syntactical problems anywhere, not even
> with arrow functions themselves and it's future proof for at least the
> cases I'm aware of.
> It's a minor addition but I think it's much nicer than either of the
> two alternatives we currently have, which lead to a lot of
> inconsistencies (it's spaces and tabs all over again).
> Semantics are the same otherwise as `() => x` would be.
> - peter
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss