On Fri, Dec 16, 2011 at 4:22 AM, Axel Rauschmayer <[email protected]> wrote:
> ... > How you work with object exemplars is almost like with classes: You have > to be aware which objects are exemplars and which ones are instances. A > useful sanity check could be to require an exemplar to have a constructor() > method. > > I'll just re-state this paragraph to illustrate that the glass is half empty: Unlike classes, object exemplars are just objects. There is no language support for detecting a object exemplar; developers have no help in avoiding pernicious debilitating bugs caused by data values in base classes. > Note that there are always two steps involved in subtyping: > 1. Extend the shared properties. > 2. Extend the instance properties. > > 99% of the time this is not what developers want or need. They want to extend the shared functions, not the shared properties. The <| operation solves the same problem that seflish solves: behavior > inheritance; they both use object literals (optional in selfish); neither > address the data-property specification problem nor the data-property > initialization problem. > > > Yes, you have to know that instance properties are always added in the > constructor. But that rule is the same with most class declaration > proposals that exist. I don’t find that rule problematic, it’s just not how > things are commonly done in mainstream languages – which tend to have a > more declarative syntax for instance members. > And I agree that the extra syntax is not good, but the result is very good. Is there another way? That is the challenge I am posing here. jjb
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

