Ruby, Smalltalk and Class Variables
patshaughnessy.net
Ruby, Smalltalk and Class Variables
1–10 of 15 posts
Re: Ruby, Smalltalk and Class Variables
#2Re: Ruby, Smalltalk and Class Variables
#3This was also discussed five years ago in this great post by Martin Fowler: http://martinfowler.com/bliki/ClassInstanceVariable.html
Re: Ruby, Smalltalk and Class Variables
#4For 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
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.Re: Ruby, Smalltalk and Class Variables
#5Towards 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…
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.
Re: Ruby, Smalltalk and Class Variables
#6Towards 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…
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.
Re: Ruby, Smalltalk and Class Variables
#7Example: 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.
Re: Ruby, Smalltalk and Class Variables
#8Earlier quoted context omitted.
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.
Re: Ruby, Smalltalk and Class Variables
#9I'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...
Re: Ruby, Smalltalk and Class Variables
#10I'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. [1] http://www.smalltalk.org/sm…