From: Robert Dober Date: 2007-08-02T22:04:26+09:00 Subject: Re: What does this warning actually mean? ------=_Part_88125_10888485.1186059860071 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/2/07, Michael T. Richter wrote: Michael I got no clue what you are trying to do here, but maybe the following is hint enouh, BTW, just do not use class variables ;). 522/23 > cat test1.rb && ruby test1.rb class << self @@a=42 def a @@a +=1 end end puts a test1.rb:3: warning: class variable access from toplevel singleton method test1.rb:5: warning: class variable access from toplevel singleton method test1.rb:5: warning: class variable access from toplevel singleton method 43 --------------------------------------------- 523/24 > cat test2.rb && ruby test2.rb class << self def a @a||=42 @a+=1 end end puts a 43 HTH Robert -- [...] as simple as possible, but no simpler. -- Attributed to Albert Einstein ------=_Part_88125_10888485.1186059860071--