ruby-1.1b9_08 (07 からみたいですが)での話です。

------------------------------
require "jcode.rb"

while gets
    print $_.tr('A-Za-z0-9', 'A-Za-z0-9')
  end
end

exit
------------------------------

を実行すると

------------------------------
$ ./t_jcode.rb t_jcode.rb
/gnu/lib/ruby/jcode.rb:45:in `+': wrong argument type false (expected String) (TypeError)
        from /gnu/lib/ruby/jcode.rb:45:in `upto'
        from /gnu/lib/ruby/jcode.rb:44:in `each'
        from /gnu/lib/ruby/jcode.rb:44:in `upto'
        from /gnu/lib/ruby/jcode.rb:71:in `_expand_ch'
        from /gnu/lib/ruby/jcode.rb:63:in `scan'
        from /gnu/lib/ruby/jcode.rb:63:in `_expand_ch'
        from /gnu/lib/ruby/jcode.rb:84:in `tr!'
        from /gnu/lib/ruby/jcode.rb:107:in `tr'
        from ./t_jcode.rb:12
zsh: 14880 exit 1     ./t_jcode.rb t_jcode.rb
------------------------------

となります。

これは次の変更に関係あるように思うのです。

------------------------------
■ 1.1b9_08(07)

ruby$ rbc.rb                                    
rbc0> a = ''
""
rbc0> a += nil
TypeError: (eval):1:in `+': wrong argument type nil (expected String)
rbc0> 

■ 1.1b9_05(06)

ruby$ /home/src/ruby-1.1b9_05/ruby ~/bin/rbc.rb 
rbc0> a = ''
""
rbc0> a += nil
""
rbc0> 
------------------------------

この変更は仕様なのでしょうか?

--
WATANABE Tetsuya HP Japan PSO
e-mail  tetsu / jpn.hp.com