From: "trans. (T. Onoma)" Date: 2004-09-13T16:13:08+09:00 Subject: Re: Singleton method on object via define_method? On Monday 13 September 2004 01:45 am, Hal Fulton wrote: > Gavin Sinclair wrote: > > I don't know what a "virtual class" would be in real terms, but > > semantically, I'd say it's some kind of object benignly masqerading as a > > class. Like a proxy object for a remote Froboz object might be said to > > masquerade as a Froboz. > > > > So just because your object above tells the world it's a "Class", I'm not > > necessarily convinced. I realise that, if this _is_ a benign deception, > > it's a deep one, because you'd expect the #class method to be truthful. > > However, that's to be expected when we're talking about the deep > > internals of Ruby. > > > > If the singleton class of an object is not treated exactly the same as a > > "normal" class in Ruby's implementation, then I think there's some > > justification for the word "virtual". > > I really think it's just a class. It has special uses, perhaps, but I don't > think it's treated specially. I can't see that it's anything other than a > real Class. Except that it is tied to the object and not the class hierarchy. So it is 'virtually' a class, but not quite ;) -- ( o _ // trans. / \ transami@runbox.com I don't give a damn for a man that can only spell a word one way. -Mark Twain