Hi,

In message "Class variable weirdness"
    on 02/05/11, Cristian Szegedy <szegedy / t-online.de> writes:

|Recently I had some problemin one of my Ruby scripts.
|I could reduce it to the following excerpt.
|I don't whether it is a bug or a feature, but
|I don't really undestand it:

Fair enough.  1.6.7 has a bug (or misfeature) in class variable
behavior.  Don't abuse it.  In 1.7.2, the result is

1
2
-:12: warning: class variable access from toplevel singleton method
-:12:in `g': uninitialized class variable @@x in Object (NameError)
        from -:19

Since class variable scope in "<<A" belongs to the outer class, this
case toplevel (Object).

							matz.