This is one of the areas that prototype-based languages simplifies although access issues might trouble class lovers. I do miss NewtonScript for some things.
Example: I create an object called Polygon with the intent to use it as a prototype. I assign the variable sides with a value of 10. So, anything with a parent pointer of Polygon gets 10. I then create Triangle from Polygon and assign sides = 3. It doesn't affect Polygon (which has its own variable), but anything that has a parent pointer of Triangles get the 3.
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.
Towards the end of this article there is a reference to the 'metaclasss'. It should probably be noted that the prefered terminology in the Ruby community now is 'singleton class' and not 'metaclass'.
For quite a while there was little agreement on this name because there was no standard method that could be called to return the singleton class and therefore no agreed upon name. The only access was via syntax:
(class <<object; self; end)
The results of this expression were called metaclass, eigenclass, singleton class, and probably a few more names.
There is now a standard method:
object.singleton_class
and so, for the most part, the naming confusion is fading away.
Thanks Gary... yea and all of these things more or less mean the same thing.
At a more technical, detailed level, however, the Ruby core team uses both the term "metaclass" (in the same sense Smalltalk uses it - the class of a class), and the term "singleton" (the hidden class of a single object instance). You can see what I mean by looking through the MRI class.c source file.
Also one of the reasons it's a little bit annoying that they picked a term that already had a different meaning not only within the wider context of programming in general, but within their own language.
I'd never read the linked Alan Kay paper about the development of Smalltalk [1]. It's fascinating!
I've been trying for awhile to find readings or videos (or anything, really) about those early days at ARPA and then PARC. Especially the detailed discussion of the smalltalk development. The names and stories are also pretty neat to read, and have already inspired a few ideas personally.
In Kay's Smalltalk, humans never saw code like that in the article: they defined classes, variables and methods through a graphical interface. The verbose syntax was for computers to read, when you saved code on one machine and loaded it on another. Humans only had to write this stuff after Gnu released a text-only interpreter; the subset of Smalltalk syntax that was originally intended for human use is pretty clear.
Example: I create an object called Polygon with the intent to use it as a prototype. I assign the variable sides with a value of 10. So, anything with a parent pointer of Polygon gets 10. I then create Triangle from Polygon and assign sides = 3. It doesn't affect Polygon (which has its own variable), but anything that has a parent pointer of Triangles get the 3.