Making that simple is not necessarily limited to prototype-based languages. Another (as good as) dead language of Apple's design, Dylan, is class-based, but has a 'each-subclass' modifier that makes a slot magically appear new in each subclass. You would have to design your polygon class for that, though; it is not something that triangle could magically add.
It is too bad someone hasn't gone back a released a retooled, s-expr version of Dylan. It was an interesting language. People should read the manual (infix) just to see how they did macros.
Comments
Making that simple is not necessarily limited to prototype-based languages. Another (as good as) dead language of Apple's design, Dylan, is class-based, but has a 'each-subclass' modifier that makes a slot magically appear new in each subclass. You would have to design your polygon class for that, though; it is not something that triangle could magically add.
It is too bad someone hasn't gone back a released a retooled, s-expr version of Dylan. It was an interesting language. People should read the manual (infix) just to see how they did macros.