From: "David A. Black" Date: 2004-08-11T08:40:41+09:00 Subject: Re: Singleton class methods Hi -- On Wed, 11 Aug 2004, Gennady wrote: > >>At least for "def Foo.f1" and "class << Foo" it is not the same one: one > >>holds "A=10" and another -- "A=20". > > > > > > But only one of them is a singleton class; the other is simply Foo > > itself :-) When you do def Foo.m, 'self' is Foo; but when you do class > > That's where a slight misunderstanding might have occurred: I was > calling "Foo itself" an original singleton class (isn't it? ;-)), and > the one created by "class << Foo" -- an anonymous singleton class of Foo > (i omitted word "anonymous" from my original reply, sorry). I realize that we should probably be saying 'virtual class' instead of 'singleton class' (at least, that's what shows up in the error messages when you try to instantiate one) -- but either way, Foo isn't one :-) It's just a regular class. David -- David A. Black dblack@wobblini.net