From: Martin DeMello Date: 2005-04-19T17:34:33+09:00 Subject: Re: [ANN] Article: Seeing Metaclasses Clearly Jim Weirich wrote: > > 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 would modify Why's metaid library thusly: > > class Object > def singletonclass > class << self > self > end > end > end > class Class > def metaclass > singletonclass > end > end +1 - in fact, I think that should go into the FAQ, under "What is the difference between a singleton class and a metaclass?" martin