From: "David A. Black" Date: 2005-05-16T10:26:55+09:00 Subject: Re: Bug printing classes - Re: infinite number of singleton_classes Hi -- On Mon, 16 May 2005, Christoph wrote: > David A. Black schrieb: > >> : >> >> Having a subclass able to call its superclass's singleton (class) >> methods is, as far as I know, the only case where one object can call >> another's singleton methods. This arrangement seems to disappear in >> the case of singleton classes of singleton classes... but at least it >> disappears consistently (i.e., even in the case of "Klass" above). > > It also works if the subclass is an ordinary singleton class of an > instance of the superclass. > >> Or something. In practical terms there's probably not much mileage to >> be had out of these. > > True - but when there is very little mileage why not simply disallow them in > the first place. I'm just not ready for: class << obj; def self.x; end; end to throw an error. It just seems like taking away too much class-ness -- though obviously if the class interface to object singleton behavior disappears entirely, that won't be an issue. > As a side note the class Klass lends itself naturally as the mother of all > singleton classes - i.e. "pouch == Klass" - a problem with this idea is that > we currently have Class < Module < Object. I'm not sure what you mean. If every object's "pouch" is Klass, it will get very crowded.... But I think I'm misunderstanding. David -- David A. Black dblack@wobblini.net