New private names proposal

Allen Wirfs-Brock allen at
Wed Dec 22 10:07:28 PST 2010

On Dec 22, 2010, at 9:47 AM, Brendan Eich wrote:

> I'm still sympathetic to Oliver's objection that declaration-style "private #x, #y" does not "look generative" enough. Agree that the sigil addresses Mark's concern about confusing literal identifiers with lexically bound names, at a Perlish price.
> David F. mentioned script concatenation. It happens freely on the web, and it is already biting us because of premature "use strict" usage where parts of the concatenation violate strict mode and most browsers don't check yet (
> To me this is the nail in the coffin for "compilation unit private name scope". I'm with dherman: lexical scope with a declaration for bindings, but it is not clear how to make the declaration look more generative. It seems important for similar things to look alike, and different-in-generativity/etc. things to look different (somehow).


function f() {
    var captured;  //this generates a new long-lived data store
    return {get value() {return captured}, set value(n) {captured=n}};


function g() {
    function inner() {};
    return inner;

I don't see why
   private foo;
is any more or less generative than:
   var captured;
   function inner() {};

They are all are declarative forms and all implicitly generate new runtime entities each time they are evaluated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list