From: "David A. Black" Date: 2005-05-05T04:04:51+09:00 Subject: Re: [RCR] Object#inside_metaclass? Hi -- On Thu, 5 May 2005, Jim Weirich wrote: > > David A. Black said: >> >> That's what I mean (in case it wasn't clear): the two terms are not >> synonymous, and we're seeing more and more of this blurring, and more >> and more use of "metaclass" where Matz and most practitioners have >> always said "singleton class". I'm hoping we can steer away from >> this. > > Then I wasn't clear either. In answer to your question 'Is there any > reason not to use the customary "singleton class"', the answer is "Yes, > because the original posters statement becomes false if you substitute > singleton class for metaclass". > > (1) The statement "all singleton classes descend from the singleton class > of Object" is false. > > (2) The statement "all metaclasses descend from the metaclass of Object" > is true > > (given that that in this context metaclass refers to those things that are > almost-metaclasses, i.e. singleton classes of classes.[1]). > > There is a difference in meaning between the word singleton class and > metaclass. The original poster was using the correct terminology and > substituting the term "singleton class" would be incorrect. I disagree; I think Ara was using the term "metaclass" to mean "singleton class". I'm taking my cue from his sample code: # (top level code) p inside_metaclass? # false class << self p inside_metaclass? # true end So his concept of "inside a metaclass" includes "inside a non-class object's singleton class" (since top-level self is not a class). He then predicates that his code only works iff "all metaclasses descend from the metaclass of Object", but if he's using "metaclass" to mean the same thing he meant it to mean in "inside_metaclass?", then this means singleton class (and the statement is false). (I'm working in the dark a little here as the examples all print 'false' for me in 1.8.2 and slightly old 1.9. I guess Ara's using a recent 1.9 -- ?) David -- David A. Black dblack@wobblini.net