From: Lionel Thiry Date: 2005-03-18T03:29:44+09:00 Subject: Re: [ruby2] will '@@' disapear in ruby2? David A. Black wrote: > Hi -- > > On Thu, 17 Mar 2005, Csaba Henk wrote: > >> On 2005-03-16, David A. Black wrote: >> >>> Do you mean like: >>> >>> def class_factory >>> return Class.new { @@x = 1 } >>> end >>> >>> class_factory.class_eval { puts @@x } # 1 >> >> >> let's go on... replace your last line with: >> >> (c = class_factory).class_eval { puts @@x } >> >> and then: >> >> c.class_variables # => [] >> @@x # => 1 >> Object.class_variables # => ["@@x"] >> >> What you suggest defines a class variable of Object, not of the nameless >> class. > > > Ugh. Well, as I've said, I'd like @@var to disappear anyway :-) > > > David > I agree! I just don't understand all this code. (and with ruby 1.9.0, I feel even more confused with @@) -- Lionel Thiry