Calamitas wrote: > On Fri, Jun 20, 2008 at 10:48 AM, James Coglan <jcoglan / googlemail.com> wrote: >> What I'm trying to get at is: given that you can't really do anything >> 'classy' with a metaclass, it seems they could quite easily be modules >> instead, and this makes more sense to me as they are just objects that store >> methods. Why do they need to be this specific type of module (i.e. Class)? > I don't know why exactly --only Matz knows-- but IMO the choice is > somewhat arbitrary because whichever is chosen, class or module, you > have to take away some of its typical behaviors to have it be > singletonsomething. [...] Some time ago, during a discussion about the addition of a singleton_class method to Ruby's Core Library, Matz said that he didn't want to expose singleton classes that way, because he viewed them as a private internal implementation detail of MRI that shouldn't be exposed to Ruby code (and force other implementations to copy that detail). Not only did he view them as an *internal* implementation detail, he actually viewed them as a *bad* implementation detail, one that he wished to change. However, he said, he hadn't been able to come up with a better idea. Since then, he has changed his mind. He has accepted the reality of singleton classes, and now his only objection to the addition of a singleton_class method is that there is no consensus throughout the community on the name of that method: singleton_class, eigenclass, metaclass, virtual_class, ... So, to cut a long story short: maybe Matz doesn't know either (-: jwm