From: Gennady Date: 2003-02-22T07:46:24+09:00 Subject: Re: Style question: using 'block_given?' It helps to keep in mind that classes in Ruby are objects as well (instances of Class). So @data there is an instance variable of an object of type Class. With all interesting consequences. Gennady. ----- Original Message ----- From: "Brian Candler" To: "ruby-talk ML" ; Cc: "ruby-talk ML" Sent: Friday, February 21, 2003 2:39 PM Subject: Re: Style question: using 'block_given?' > > This is the class instance variable police. Freeze! Keine Bewegung! > > > > ;-) > > It's a fair cop :-) I had a hard time getting my head round this one: > > - Class variables (@@data) are fine. > > - Instance variables in a module are fine: mix it into a class, and > instances of that class get those instance variables too > > - But @data as a class instance variable? You can't even refer to it, > except from within a class method. (Unlike a class variable, @@data, > which you can use within a normal instance method) > > It looks like something which the language has by accident more than by > design :-) > > Regards, > > Brian. > >