From: Christoph Date: 2002-05-30T22:47:16+09:00 Subject: RE: possible bug: stack dump with <<-String, #{...} and large loops > From: ts [mailto:decoux@moulon.inra.fr] > To: ruby-core@ruby-lang.org (redirected) ... > The output is normal, for me. Following this thread a bit was very interesting for me, since I had the misconception that leaving an eval context would destroy all variables local to current eval context - as in eval "a = 1" p eval "defined? a" # => nil Out of curiosity, is this output premonition intentional? --- def aa(x) if x eval "p a" # premonition end a = 1 end aa(true) # => nil --- and --- def aa "#{}" eval "a = 1" p "#{defined? a}" end def bb "#{}" eval "b = 1" p "#{defined? b}" b = 2 # premonition end def cc eval "c = 1" p "#{defined? c}" end aa # => "local-variable(in-block)" bb # => "local-variable" cc # => "local-variable" --- > > The problem with my example, is that the nodes in "#{...}" are compiled > in > a context and re-used in another context. > If you try it with "ruby 1.6.7 (2002-03-01) [i686-linux]" you'll see a > segfault. This happens on windows rubies too. /Christoph