class Foo
  @@x = 10
end

Foo.class_eval('@@x') # => 10  # Part-I
Foo.class_eval{ @@x } # =>  # Part - II
# ~> -:5:in `block in <main>': uninitialized class variable @@x in
Object (NameError)
# ~>   from -:5:in `class_eval'
# ~>   from -:5:in `<main>'

Why does Part-I and Part-II behave differently ?

-- 
Posted via http://www.ruby-forum.com/.