@ is also sort of planned as a syntax to access private properties of an object.

http://wiki.ecmascript.org/doku.php?id=harmony:private_name_objects

Also mentioned in this thread: https://mail.mozilla.org/pipermail/es-discuss/2012-January/019876.html

Herby

Kevin Smith wrote:
One thing that has come up in my number crunching is the repetition of
the character sequence "this.".  If we allowed @ (ala CoffeeScript) as a
shorthand for "this.", then we could, if nothing else, shave perhaps
1-3% off of the size of minified code.

Other advantages:

- A pain point for doing OO programming in javascript is the required
"this" repetition.  A shorthand would alleviate that pain.
- If private names are allowed as the "name" in @name, then we would
have a concise syntax for private "member" access.

See this example <https://gist.github.com/2007371>. (This example
describes a hypothetical class syntax, which I'm not proposing in this
thread.  But it does illustrate the @name concept.)

kevin


------------------------------------------------------------------------

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to