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.
Comments
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:
The results of this expression were called metaclass, eigenclass, singleton class, and probably a few more names.There is now a standard method:
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.
Yep and that was one of the reasons that the naming confusion persisted for so long.
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.