From: Trans Date: 2005-12-10T12:52:36+09:00 Subject: Re: About class methods jonathan leonard wrote: > T, > > > Any given > > class can have infinitely many singleton subclases, no? > > Oops. This statement from the page you linked to seems to answer that > question: > > If 'a' already has a singleton class then any more singleton methods you > define are just added to it. > > Does this mean that a class can have only one singleton subclass and > that all methods added anywhere in the program are added to that single > instance? If so, I wonder why this is. It seems to me to be more > useful if you can have infinitely many singleton subclasses. I suppose > you still can have divergence of this sort with individual instances, > but why not with the class itself? Well, I think its basically because Matz used the class nothing more then an easy way to implement ad hoc methods. It was the methods that mattered to him, not the class --the class was just a vehicle. He's talked about the possibility of not utilizing the class in the future. I assume that means these methods would then just exit in a separate underlying namespace of the class, as opposed to a separate class altogether. Which may also be the reason he's allowed then name to remain a bit amorphis and never provided a convenience method for accessing it. T.