Re: extends keyword instead of superclass ...

2011-04-05 Thread Juan Ignacio Dopazo
I've been thinking about something Brendan said in his last podcast about how the community and TC39 can't agree on the syntax for class initializers because of how flexible he made it at the beginning. So a little idea came to me. How about adding an Object.getMetaProperties or

Re: extends keyword instead of superclass ...

2011-03-30 Thread Dmitry A. Soshnikov
On 30.03.2011 1:24, Allen Wirfs-Brock wrote: On Mar 29, 2011, at 12:14 AM, Dmitry A. Soshnikov wrote: On 29.03.2011 2:51, Allen Wirfs-Brock wrote: ... Regarding classes in general I have the following table of classes kinds: |first-class | second-class (or

Re: extends keyword instead of superclass ...

2011-03-29 Thread Dmitry A. Soshnikov
On 29.03.2011 2:51, Allen Wirfs-Brock wrote: On Mar 28, 2011, at 1:53 PM, Dmitry A. Soshnikov wrote: Exactly. Classes are not about just the class keyword, but about the _ability to classify_, i.e. to program in classified (i.e. with object-patterned programming). JS supports (and supported

Re: extends keyword instead of superclass ...

2011-03-29 Thread Juan Ignacio Dopazo
Mixins are a great idea. Whatever decision is made about the position and name of the inheritance declaration, they add a lot of value and are very easy to understand. A couple of related ideas: class Vector { superclass: Point, uses: Comparable } uses looks like a better fit. It's shorter

Re: extends keyword instead of superclass ...

2011-03-29 Thread Allen Wirfs-Brock
On Mar 29, 2011, at 12:14 AM, Dmitry A. Soshnikov wrote: On 29.03.2011 2:51, Allen Wirfs-Brock wrote: ... Regarding classes in general I have the following table of classes kinds: |first-class | second-class (or first-order)

Re: extends keyword instead of superclass ...

2011-03-28 Thread Allen Wirfs-Brock
On Mar 27, 2011, at 10:31 PM, Brendan Eich wrote: That strawman is essentially functional record update for setting __proto__ AKA [[Prototype]], although it reads backwards compared to FRU in ML-family languages. Those languages put the update on the right, often linked using 'with'

Re: extends keyword instead of superclass ...

2011-03-28 Thread Dmitry A. Soshnikov
On 28.03.2011 0:05, Brendan Eich wrote: On Mar 27, 2011, at 11:33 AM, Juan Ignacio Dopazo wrote: On Sat, Mar 26, 2011 at 6:31 PM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com mailto:dmitry.soshni...@gmail.com wrote: Why not just to use already reserved `extends` keyword for

Re: extends keyword instead of superclass ...

2011-03-28 Thread Allen Wirfs-Brock
On Mar 28, 2011, at 1:53 PM, Dmitry A. Soshnikov wrote: Exactly. Classes are not about just the class keyword, but about the _ability to classify_, i.e. to program in classified (i.e. with object-patterned programming). JS supports (and supported all these years both approaches:

Re: extends keyword instead of superclass ...

2011-03-28 Thread Brendan Eich
On Mar 28, 2011, at 12:29 PM, Allen Wirfs-Brock wrote: Dmitry's suggestion of #proto or a similar sigil-distinguished name makes me wonder, though: could we have FRU via the spread operator *and* proto presetting without adding a funky [no LineTerminator here] proto infix operator?

Re: extends keyword instead of superclass ...

2011-03-28 Thread Allen Wirfs-Brock
On Mar 28, 2011, at 5:36 PM, Brendan Eich wrote: On Mar 28, 2011, at 12:29 PM, Allen Wirfs-Brock wrote: That is why in my proposal class Foo {}; is defined to mean almost exactly the same thing as function Foo() {}; (but things start to change when you put something between the

Re: extends keyword instead of superclass ...

2011-03-27 Thread Juan Ignacio Dopazo
On Sat, Mar 26, 2011 at 6:31 PM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: Why not just to use already reserved `extends` keyword for specifying a superclass? These XML-like braces looks not so elegant. I asked this question a couple of days ago. The answer is quite simple.

Re: extends keyword instead of superclass ...

2011-03-27 Thread Dmitry A. Soshnikov
On 27.03.2011 22:33, Juan Ignacio Dopazo wrote: On Sat, Mar 26, 2011 at 6:31 PM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com mailto:dmitry.soshni...@gmail.com wrote: Why not just to use already reserved `extends` keyword for specifying a superclass? These XML-like braces looks

Re: extends keyword instead of superclass ...

2011-03-27 Thread Juan Ignacio Dopazo
Sure, it was discussed in this thread https://mail.mozilla.org/pipermail/es-discuss/2011-March/012963.html https://mail.mozilla.org/pipermail/es-discuss/2011-March/012963.htmlJuan ___ es-discuss mailing list es-discuss@mozilla.org

Re: extends keyword instead of superclass ...

2011-03-27 Thread Brendan Eich
On Mar 27, 2011, at 11:33 AM, Juan Ignacio Dopazo wrote: On Sat, Mar 26, 2011 at 6:31 PM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: Why not just to use already reserved `extends` keyword for specifying a superclass? These XML-like braces looks not so elegant. I asked this

Re: extends keyword instead of superclass ...

2011-03-27 Thread David Herman
Allen makes the point that class D extends B {...} may look too much like languages where it means something quite different. Yeah, I just don't buy the argument that having different semantics should lead to different syntax: it proves too much. By definition, JS has a different semantics

Re: extends keyword instead of superclass ...

2011-03-27 Thread Allen Wirfs-Brock
Consistently extending object literals into class literals was one of the goals of this particular design but that goal isn't a requirement. At the latest TC39 meeting some participants expressed an opinion that the prototype specification for an object literal should go outside of the

Re: extends keyword instead of superclass ...

2011-03-27 Thread Brendan Eich
Hi Allen, all good points. A few thoughts below, interspersed. On Mar 27, 2011, at 4:39 PM, Allen Wirfs-Brock wrote: At the latest TC39 meeting some participants expressed an opinion that the prototype specification for an object literal should go outside of the brackets.

extends keyword instead of superclass ...

2011-03-26 Thread Dmitry A. Soshnikov
Hi, Just a small note on http://wiki.ecmascript.org/doku.php?id=strawman:super_in_object_initialisers (reading currently) Why not just to use already reserved `extends` keyword for specifying a superclass? These XML-like braces looks not so elegant. Coffee users the same classes syntactic