From: Bertram Scharpf Date: 2005-03-25T19:49:27+09:00 Subject: Re: Understanding instance variables Hi, Am Freitag, 25. M�r 2005, 09:30:01 +0900 schrieb David A. Black: > On Fri, 25 Mar 2005, Bertram Scharpf wrote: > > > > c's Singleton < C < Object > > > >can have their own instance variables. > > > >>>c=class C ; self ; end.new > >>>s=class << C ; self ; end > > Did you mean class << c ? (You had mentioned c's singleton class.) > But either way... Eh, what's the difference? > >>>[c,s,C,Object].zip( %w-I S C O-).each { |x,y| x.instance_eval '@x='+y.inspect } > >>>[c,s,C,Object].collect { |x| x.instance_eval '@x' } > >=> ["I", "S", "C", "O"] > > > >Or is there something I missed? > > ... that's correct: any object can have its own instance variables. Ah, thanks! Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de