From: "David A. Black" Date: 2005-05-05T08:50:19+09:00 Subject: Re: [RCR] Object#inside_metaclass? Hi -- On Thu, 5 May 2005 Ara.T.Howard@noaa.gov wrote: > On Thu, 5 May 2005, David A. Black wrote: > >> Isn't that the case we talked about before where you clarified that >> you didn't think it should be 'true' for singleton classes in general? >> If not, them I'm retroactively confused again about the whole thread >> and the use of terminology. > > lol. i've never heard of anyone being retroactively confused - but i'm sure > i > am all the time. i think. maybe. i'm not sure. > > anyways... this is the right __behaviour__ if not the right name. i'll > change > it to inside_singleton? or something in my source. > > too bad you can't edit usenet - anyone would think/know i'm a complete dolt > if > reading this thread! Well, I think I may be the dolt, since I always seem to be present when these misunderstandings come up (me and Jim, me and you...) :-) But in fact I think it does come back to the terminology problem. inside_singleton? is a little unclear, and inside_singleton_class? is a bit lengthy Maybe the best name would be just: singleton_class? So then you would have: obj = Object.new c = (class << obj; self; end) c.singleton_class? # true class << obj singleton_class? # true end etc. This replaces the explicit "inside" term with the implicit fact that, inside a class definition, self is the class -- so "insideness" is already encapsulated in the self mechanism. (At some point I'll try to go back and look at the examples and figure out whether I have anything substantive to say about the whole idea :-) David -- David A. Black dblack@wobblini.net