From: ale@... Date: 2002-01-06T09:52:26+09:00 Subject: [ruby-talk:30317] Exceptional NameError without halt I'm feeling something strange is going on here. Dunno what has changed, but I guess it has something to do with the earlier discussion about how puts should be fixed. Anyway, here are the that cases working showed with four different versions of ruby. $ ruby -v -d -e'a = "\n"*3;' ruby 1.6.5 (2001-09-19) [i686-linux] $ ruby -v -d -e'a = "\n"*3;' ruby 1.6.6 (2001-12-26) [i686-linux] $ ruby -v -d -e'a = "\n"*3;' ruby 1.6.6 (2002-01-05) [i686-linux] $ ruby -v -d -e'a = "\n"*3;' ruby 1.7.2 (2002-01-05) [i686-linux] And here are the cases that show inconcistency. 1.6.5 ok 1.6.6 stable doesn't work 1.6.6 snapshot doesn't work 1.7.2 ok $ ruby -v -d -e'puts "\n"*3;' ruby 1.6.5 (2001-09-19) [i686-linux] # notice these three empty lines $ ruby -v -d -e'puts "\n"*3;' ruby 1.6.6 (2001-12-26) [i686-linux] Exception `NameError' at -e:1 - undefined method `to_ary' for "\n\n\n":String # notice we have the lines again but not without an error $ ruby -v -d -e'puts "\n"*3;' ruby 1.6.6 (2002-01-05) [i686-linux] Exception `NameError' at -e:1 - undefined method `to_ary' for "\n\n\n":String $ ruby -v -d -e'puts("\n"*3);' ruby 1.7.2 (2002-01-05) [i686-linux] # the latest from cvs works ok again And note that the problem only shows up as an extra text (the error doesn't halt the interpreter) and only when the switch -d has been set! Pardon me if this has been already sorted out. (And just when I finished the whole mail...I found out that there's even simpler case which doesn't call String#* :) ruby -v -d -e'puts "foo"' ruby 1.6.6 (2002-01-05) [i686-linux] Exception `NameError' at -e:1 - undefined method `to_ary' for "foo":String foo - Aleksi