Syntax shortcut for accessing properties on the current context ("this")
andrea.giammarchi at gmail.com
Mon Jul 27 14:38:18 UTC 2015
the real bummer to me is that `with` statement has been deprecated and
killed without a replacement but AFAIK the "dot-stache" operator should
come to save us from typing:
prop = Math.random();
although I cannot even find the strawman ... and this seems outdated
it's to define properties only ... uhm ... if I'll find the proposal, I'll
link to it.
On Mon, Jul 27, 2015 at 2:47 PM, Nathaniel Higgins <nat at nath.is> wrote:
> Ah yes, silly me.
> What about %prop or $prop? When it’s something you have to do a lot,
> repeatedly typing `this.` can be a pain. There’s definitely a case for it
> as many other languages use it.
> Nathaniel Higgins
> Sent with Airmail
> On 27 July 2015 at 14:46:33, Andrea Giammarchi (
> andrea.giammarchi at gmail.com) wrote:
> apparently the @ has been booked already for decorators
> I also personally think we don't really need yet another magic shortcut
> that but that's just my opinion.
> Best Regards
> On Mon, Jul 27, 2015 at 2:23 PM, Nathaniel Higgins <nat at nath.is> wrote:
>> In CoffeeScript (and a few other languages including Ruby I believe),
>> there is a syntax shortcut for simplifying accessing properties on the
>> current context (this variable), which is something you have to do often.
>> This looks something like `@prop`, which is synonymous with `this.prop`.
>> I’m not sure if the “@“ character is used for anything else yet in
>> it is.
>> Nathaniel Higgins
>> Sent with Airmail
>> es-discuss mailing list
>> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss