On 2005-03-16, David A. Black <dblack / wobblini.net> 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.

Csaba