From: Calamitas Date: 2006-12-20T00:10:35+09:00 Subject: Re: [ ruby-Bugs-6820 ] #ancestors never includes the singleton class (inconsistent) On 12/19/06, Yukihiro Matsumoto wrote: > I just remembered I made decision that singleton classes (or > eigenclasses) were "real" anonymous classes rather than theoretical > place holder. That means having singleton classes in ancestors list > makes sense. I will change the behavior in the future. > > This is a step toward eigenclass method. Then would you consider making the following changes as well? * Return singleton classes from ObjectSpace#each_object * Call Class#inherited when singleton classes are created * "Fix" Class#superclass for the singleton class of a class: class A ; end class B < A ; end c = class << B ; self ;end #=> # c = c.superclass #=> # c = c.superclass #=> # ... I'd expect to see the sequence #, #, #, Class, Module, Object, nil. That is the way 1.9 behaves, except that BasicObject is the root of the hierarchy, and that BasicObject#superclass raises a TypeError. Peter