On Mar 31, 2012, at 5:19 PM, Domenic Denicola wrote:

> As a quick follow-up:
> 
> Perhaps adding non-arcane-incantation private name declarations would be 
> enough to push maximally-minimal classes from “nice, but are they worth it?” 
> to “this gives us something we can’t get anywhere else.” To wit:
> 
> class Set extends Collection {
>    private setContents, setTally
> 
>    constructor(initialSize = 2) {
>        this.{
>            @setContents: new Array(initialSize),
>            @setTally: 0
>        }
>    }
> 
>    // ...
> }
> 

Using a private declaration to define privateName bindings is still on the 
table.  I just didn't show it in these example.  However, it would most likely 
go outside of the class declarations:

private setContents, setTally;

class Set extends Collection {

   constructor(initialSize = 2) {
       this.{
           @setContents: new Array(initialSize),
           @setTally: 0
       }
   }

   // ...
}

Allen

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

Reply via email to