From: George Ogata Date: 2006-02-27T07:38:36+09:00 Subject: Re: Scope of constants in instance_eval "Phrogz" writes: > Evaling as a string works. (Constant is resolved.) But only in 1.9, if I understand you correctly. g@crash:~/tmp$ cat test.rb class C def initialize &b instance_eval(&b) end X = 2 end C.new{puts eval('X')} g@crash:~/tmp$ ruby -v test.rb ruby 1.8.4 (2005-12-24) [i686-linux] test.rb:8: (eval):1: uninitialized constant X (NameError) from test.rb:3:in `eval' from test.rb:8 from test.rb:3:in `initialize' from test.rb:8 g@crash:~/tmp$ ruby19 -v test.rb ruby 1.9.0 (2006-02-15) [i686-linux] 2