From: Dave Thomas Date: 2002-01-03T07:03:33+09:00 Subject: [ruby-talk:30080] Problem with puts and friends The new #puts has roughly the following logic: def puts(*args) for arg in args begin ary = arg.to_ary ary.each {|elem| puts(elem)} rescue NameError internal_puts arg.to_s end end end So, if the argument can be converted into an array, it is, and the result is then printed recursively element at a time. If it can't, then it is printed as a string. However, if the '-d' command line option is given, then Ruby reports the failure to convert the parameter to an array: dave[~/tmp 16:01:29] ruby -d -e "puts 'hello'" Exception `NameError' at -e:1 - undefined method `to_ary' for "hello":String hello This is somewhat disconcerting. I'm not sure what the correct fix is. Should we change rb_check_convert_type, or is there a better way? Dave