From: Gary Wright Date: 2009-05-16T14:24:33+09:00 Subject: Re: Superclass of eigenclass On May 15, 2009, at 7:46 AM, Joshua Ballanco wrote: >> Right. So then the question: is there a compelling reason that they >> should be allowed to be subclassed? (I mean, other than the >> obvious: "Because that's not the way Ruby was designed" answer.) I >> cannot come up with any compelling technical reason why the >> artificial limitation of being unable to subclass "virtual >> classes"[1] should exist. The purpose of an eigenclass is to hold per object methods. As such, there is always always a one-to-one relationship between an eigenclass and its "eigeninstance" (sorry, but I can't think of a clearer term at the moment). The idea of subclassing an eigenclass contradicts that one-to-one relationship. If you could subclass an eigenclass, there would be no way to cause ruby to search the new subclass for instance methods since it wouldn't have a matching eigeninstance (sorry, again). It would not be in the method lookup chain of any object. Just to be complete, I'll point out that there is a way for eigenclasses to have a subclass and that is when the eigeninstances are themselves classes. This is most clear in 1.9. If B is a subclass of A, then B.eigenclass will be a subclass of A.eigenclass. Even in this case A and B have to exist before their eigenclasses can be accessed and not the other way around. Gary Wright