From: "David A. Black" Date: 2005-04-18T20:47:49+09:00 Subject: Re: [ANN] Article: Seeing Metaclasses Clearly Hi -- On Mon, 18 Apr 2005, why the lucky stiff wrote: > I've written a very nuts+bolts article on metaclasses (aka virtual classes or > metaobjects), since they still lurk under a shroud of fear and enigma. > > > > I'm hoping this will help uncover the truth. If anything is unclear, please > report it. Shed a light. For some reason the first 1/8 inch or so on the left are cut off on my browser. I don't know whether it's a CSS thing or a browser thing (Netscape 6). So "methods" comes out as "thods", etc. The tutorial itself looks good, though the terminology in this area continues to be a problem. My understanding is that the most general term is "singleton class", and that "metaclass" is a special term for singleton class of a Class object. (See Pickaxe, 2nd ed., p. 382.) So, for example, I would rename your Object#metaclass method #singleton_class, since it applies to all objects (as per RCR 231). Then there's "virtual class", which I think is the weakest and least useful term, certainly at a general level. The Matz paraphrase on p.382 suggests that virtual-ness is more a matter of implementation than anything language-level, which is good. I haven't checked, but I'm hoping the > 1.8 error messages will cease to refer to "virtual" classes (e.g., when you try to get at the singleton class of a Fixnum). David -- David A. Black dblack@wobblini.net