> It seems like an unfortunate inconvenience to require any code refactoring 
> and lose the shorthand @ this-access if you just want to make a private 
> property on an object be public.  Instead of just restricting the token to 
> the right of a @ or .@ construct be a private name, perhaps it would be 
> useful to also permit an explicitly declared public name?

I wouldn’t mix public and private, but it would be nice to have symmetry – only 
having a `this` shortcut for private names feels odd. How about the following?

    function Point(everyone, secret) {
        this.everyone = everyone;
        this.@secret = secret;
    }

    //---- Short:

    function Point(everyone, secret) {
        .everyone = everyone;
        .@secret = secret;
    }

    //---- Shorter:

    function Point(this.everyone, this.@secret) {
    }

    //---- Shortest:

    function Point(.everyone, .@secret) {
    }

To me, consistency is much more important than saving characters.

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to