From: Christoph Date: 2002-03-03T08:48:41+09:00 Subject: Re: class vars broken in 1.6.7 "Joel VanderWerf" wrote in .... > > ..and the following prints "0": > > class C > @@cv = 0 > class << self > def test > @@cv = 5 > p @@cv > end > end > > test > end These observation are true for the main branch too. As far as I am concerned this is a very good thing (besides breaking some scripts). It simply means that class variables and ``meta-class'' variables are not the same any more, but if you really need it you can sort of reconstitute the old behavior in (cvs at least) --- class C @@cv = 0 meta = class << self; self end meta.send (:define_method, :cv) {@@cv} meta.send (:define_method, :cv=) {|x| @@cv = x} end C.cv = 5 class C p @@cv # => 5 end class D < C;end p D.cv # => 5 ---- /Christoph