From: Gennady Date: 2004-08-11T08:50:34+09:00 Subject: Re: Singleton class methods David A. Black wrote: > 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 > Hmm, I like "virtual class" much better. I used term "singleton" for describing Foo's class simply to reflect that there's only one instance of class "Class" representing "Foo". Seems like my terminology was misleading. Gennady.