Hi --

On Tue, 19 Apr 2005, Jim Weirich wrote:

> I don't have the pickaxe with me (its at work), but let me quote from "Putting
> Metaclasses to Work" by Ira R. Forman and Scott H. Danforth.  The quote is
> longish, but useful in understanding metaclasses.  From the Preface:
>
>> "If one thinks of objects as cookies, then classes are analogous to cookie
>> cutters.  Cookie cutters are teamplates that are used to make and determine
>> the properties of cookies; classes make and determine the properties of
>> objects. But ow are cookie cutters themselvfes made? Let us ssay that they
>> are pressed from sheet metal using a cookie cutter press (a piece of heavy
>> machinery). So, if a cookie cutter press is ed to make cookie cutters, what
>> is used to make classes?  The answer is a metaclass."
>
> So, the instances of a metaclass are classes.  Ruby happens to implement
> metaclasses as singleton classes (or virtual classes, whatever).  So the
> singleton class of a class is a metaclass, but the singleton class of
> something that is not a class, would not be a meta class.

I have some trouble applying the quotation to Ruby, since classes make
but don't determine the properties of objects, and also -- even more
-- because that description of a metaclass sounds more like class
Class than like singleton classes of classes (since class Class is the
only thing in Ruby from which arbitrarily many Class objects can be
"pressed").  So it doesn't really seem like singleton classes of
classes are accounted for in the quotation.

(I will try to consolidate my comments next time and not respond three
times in a row :-)


David

-- 
David A. Black
dblack / wobblini.net