Syntax to get same object that method was called on (Easymethodchaining)
Erik Arvidsson
erik.arvidsson at gmail.com
Mon Oct 26 13:04:45 UTC 2015
There used to be a proposal in the ES5 timeframe for cascade expressions.
This is what later made it into Dart using the `..` syntax. For ES the
syntax was using `.{`. The proposal never gained a lot of traction so it
was removed.
https://github.com/google/traceur-compiler/issues/405
On Mon, Oct 26, 2015 at 6:02 AM Eric Suen <eric.suen.tech at gmail.com> wrote:
> What I means is obj.(f1() , f2()) may better than obj.f1()#f2(), thought
> your syntax is shorter.
> 1. it does not need new operator.
> 2. # is comment in some other languages
> 3. if you want result, you can do with obj.(a = f1(), b = f2()) or [a,b] =
> obj.(f1(), f2())
>
> "Edwin Reynoso" <eorroe at gmail.com>
> That's not possible @Eric
>
> On Mon, Oct 26, 2015 at 2:20 AM, Eric Suen
> <eric.suen.tech at gmail.com> wrote:
> with
>
> obj.(doSomething(), doSomething2());
>
> you don’t need to introduce new operator.
> _______________________________________________
> es-discuss mailing list
> mailto:es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> 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/20151026/80df4a7c/attachment.html>
More information about the es-discuss
mailing list