shortcuts for defining block-local private names, plays nicely with @foo syntax

Herby Vojčík herby at mailbox.sk
Fri Jan 20 15:34:16 PST 2012


Hello,

since @-prefixed syntax to access private-named properties seems to win 
in the private grounds (and it is good thing), I'd like kill two birds 
with one stone:
  - private keyword seemed to lose its role
  - to access property via @foo, I must 'let foo = Name.create()' first

So let us allow:
   ... {
     private foo, bar;
     ...
     agent. at foo = ...;
     ...
     more uses of @foo and @bar
     ...
   }
in imperative (code-containing, semicolon-delimited) blocks and
   ... {
     private [foo, bar],
     ...
     @foo: Date.now(),
     @bar: cowboys.length,
     ...
     aMethod () {
       ... use @foo and @bar
     }
   }
in declarative (data-describing, comma-delimited) blocks.

In both cases let it be the declaration of (one-time lexical 
block-local) private names foo and bar. For any curly block. Without 
need to define these singletons explicitly and wrap them so they are 
only visible where due,

Herby


More information about the es-discuss mailing list