At Fri, 17 May 2002 05:46:22 +0900,
Hal E. Fulton <hal9000 / hypermetrics.com> wrote:

> 1. Why does MyClass.class return Class, if the
> class of MyClass is really MyClass's metaclass?

MyClass.class never be MyClass.  Every class is instance of Class or
its subclass. 

   class Object
     def virtualclass
       # This method *creates* virtual class if that does NOT exists yet. 
       class << self
         self
       end
     end
   end

   class Class
     alias metaclass virtualclass
   end

   class MyClass
   end

   c, d =  MyClass.class, MyClass.virtualclass
   p [c, d, c == d]

generates

  [Class, #<Class:MyClass>, false]

with ruby17. 

> 2. Why do we create a metaclass if all classes are
> instances of Class? Couldn't Class have been used
> as a generic metaclass?

To inherit class methods, perhaps. 

  class A
    def A.m
      self
    end
  end

  class B<A
  end

  p B.m

In this case B.m returns class B.  A.m is singleton methods of A,
i.e., a method of the metaclass of A.  That is only situation
singleton method is inherited. 

-- Gotoken