From: Gary Wright Date: 2009-05-13T01:02:15+09:00 Subject: Re: Superclass of eigenclass On May 12, 2009, at 10:38 AM, Danny O cuiv wrote: > However, what is clear from the above is that X is not a superclass of > e. This is a problem for two reasons: > > (i) Certain metaprogramming techniques (e.g the one on page 295 or > RPL) > involve calling super in an eigenclass method, with the intention of > picking up the implementation of the same method in the original > class. > If X is not a superclass of e, this shouldn't work. But it does. > > (ii) Calling the ancestors on e gives: > e.ancestors # => [X, Object, Kernel] > So we have X appearing as an ancestor of e, when it is neither a > superclass of e nor an included class in e. > > Somebody here must have a better handle on this than me. Please chip > in > if you do. I think you need to decouple the inheritance relationships (what superclass reveals) from the method lookup chain (what ancestor partially reveals) in order to understand the semantics. Arguably this could all be clearer via some better naming. Confusion comes from: -- the super keyword uses the method lookup chain, not the superclass chain -- the ancestor method reports on the method lookup chain, not the inheritance chain -- the ancestor method doesn't show eigenclasses, they are implied