Re: Class Syntax Proposal, Complete With Arguments For and Examples.

2011-09-18 Thread Mike Shaver
On Sun, Sep 18, 2011 at 1:36 AM, Jonathan Dumaine jonathan.duma...@dumstruck.com wrote: You could go all the way and make classes a very strict subset of the language: throw an error if the user tries to set a property of a class instance that has already been declared private [...] I would

Re: Class Syntax Proposal, Complete With Arguments For and Examples.

2011-09-18 Thread Mark S. Miller
On Sat, Sep 17, 2011 at 10:36 PM, Jonathan Dumaine jonathan.duma...@dumstruck.com wrote: Hello Mark, I think mistake is a harsh word. My apologies if it came across as harsh. I did not intend harshness, quite that opposite. That's why I mentioned that the committee almost made the same

Re: Class Syntax Proposal, Complete With Arguments For and Examples.

2011-09-17 Thread Mark S. Miller
Hi Jonathan, Your class recapitulates a mistake the committee almost made as well. Your private and public member are in the same namespace. Private members should not affect the behavior of the public API. However, if a class makes an extensible instance, and a client of the instance tries to

Re: Class Syntax Proposal, Complete With Arguments For and Examples.

2011-09-17 Thread Jonathan Dumaine
Hello Mark, I think mistake is a harsh word. It is really a question of how much the community wants javascript to adopt object-oriented paradigms. You could go all the way and make classes a very strict subset of the language: throw an error if the user tries to set a property of a class