On Thu, May 7, 2009 at 8:35 AM, Danny O cuiv <danny.ocuiv / gmail.com> wrote:
> On page 261 of The Ruby Programming Language, they state:
>
> "Class objects are special: they have superclasses. The eigenclasses of
> class objects are also special: they have superclasses, too. The
> eigenclass of an ordinary object stands alone and has no superclass."
>
> This last sentence has me puzzled. The only possible interpretations
> that I can imagine would be that calling superclass on the eigenclass of
> an ordinary object would result in either (a) a method not found or (b)
> the value nil being returned. However, neither of these is the case.

Not exactly an answer to your question, but here are some thoughts.

>> class A
>>   p ancestors
>> end
[A, Object, Kernel]

>> class A
>>   f = class << self; self; end
>>   p f.ancestors
>> end
[Class, Module, Object, Kernel]

>> a = "a"
=> "a"
>> k = class << a; self; end
=> #<Class:#<String:0x25ad14>>
>> k.ancestors
=> [String, Enumerable, Comparable, Object, Kernel]