From: Robert Dober Date: 2009-05-12T19:16:57+09:00 Subject: Re: Superclass of eigenclass On Mon, May 11, 2009 at 2:42 PM, Danny O cuiv wrote: > Rick, Robert, > > Thanks again for your replies. > > Rick wrote: > >> If you go in and look at the implementation, you'll find that the >> eigenclass of String has a superclass slot which points to the >> eigenclass of Object, but the superclass method implementation skips >> past 'singleton' classes, until it gets to > > To me, that smacks of being ad hoc and inconsistent. The superclass > method implementation skips past 'singleton' classes, until it gets to > #. But # is itself a 'singleton' class, so I > can't see the rationale there. In other words, I can't really grasp what > semantics are being exposed. > > Robert wrote: > >> But in reality singleton classes, yes that is what I prefer ;) are >> very simple because you really never care too much about their >> inheritance. The more I work with Ruby the less I care about >> inheritance in general. > > I would disagree that one would never really care too much about an > eigenclass's inheritance. Example 8-10 on page 294 of the Flanagan/Matz > book details a very nice-looking technique for doing interception. (The > particular example uses the technique to wrap tracing code.) This > technique depends on accessing the original implementation of the method > by calling super in an eigenclass, so the inheritance of the eigenclass > is crucial here. yes but I was talking about the other direction in the inheritance tree, the super class of a singleton class is very well defined as the class of the singleton's class object's class. Are we cycling here ;)? Cheers Robert -- Si tu veux construire un bateau ... Ne rassemble pas des hommes pour aller chercher du bois, préparer des outils, répartir les tâches, alléger le travail… mais enseigne aux gens la nostalgie de l’infini de la mer. If you want to build a ship, don’t herd people together to collect wood and don’t assign them tasks and work, but rather teach them to long for the endless immensity of the sea. -- Antoine de Saint-Exupéry