arrow syntax unnecessary and the idea that "function" is too long

Irakli Gozalishvili rfobic at gmail.com
Mon May 9 02:21:05 PDT 2011


On Monday, 2011-05-09 at 11:02 , Kyle Simpson wrote: 
> Let's ignore popularity level for the moment, no other proposal has analog 
> > of `=>` which is a solution for a real problem:
> > 
> > var self = this;
> > function callback() {
> >  self....
> > }
> 
> Maybe I missed something, but didn't Brendan's #-function proposal specify 
> lexical `this` binding, so that:
> 
> function foo() {
>  this.bar = "baz";
>  return #(x){ this.bar = x; };
> }
> 
> Isn't that the spirit of what => would give us?
> 
Yes and this case makes following example extremely confusing:

MyObject.prototype.bar = #(x) { this.bar = x }

Is this instance of MyObject ? So we need to use `#` in some places, but in other cases we need to stick to long form `function`. I think `->` and `=>` is way more intuitive and simple. 
> --Kyle
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110509/038fe461/attachment.html>


More information about the es-discuss mailing list