"Rich Kilmer" <rich / infoether.com> writes:

> So then, technically speaking, Object does have a "superclass" of
> the class Class created to point to Kernel.  I do realize this is
> invisible to Ruby programs (as are all singleton classes), but it's
> there nonetheless.  Correct?

I'm not sure about the first part: It's internally a T_ICLASS, but
Ruby fakes out the type to be the type of the included module. If you
look at object.c and comment out the three lines shown:

     static VALUE
     rb_class_superclass(klass)
         VALUE klass;
     {
         VALUE super = RCLASS(klass)->super;

         //while (TYPE(super) == T_ICLASS) {
         //    super = RCLASS(super)->super;
         //}
         if (!super) {
             return Qnil;
         }
         return super;
     }


you can use .superclass to view these classes.

  dave[ruby/ruby 8:55:52] ./ruby -e 'p Object.superclass' 
  #<Kernel:0x401c3c94>
  dave[ruby/ruby 8:55:58] ./ruby -e 'p Object.superclass.type'
  Kernel



Cheers


Dave