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.
Polygon := Object clone do( sides := 10 )
Triangle := Polygon clone
Triangle sides println # => 10
Triangle sides := 3
Triangle sides println # => 3
Polygon sides println # => 10For 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.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.
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.
[1] http://www.smalltalk.org/smalltalk/TheEarlyHistoryOfSmalltal...
ref: stvn == "Stevan Little" who is the creator of Moose (https://metacpan.org/module/Moose) & and it's MOP underpinnings (https://metacpan.org/module/Class::MOP)