From: ts Date: 2008-04-02T01:13:56+09:00 Subject: Re: Why Ruby do not optimize code at all? Marcin Miel��y��ski wrote: > Well, that's why I'd rather call it temporary breakage since the sources > say the author's been aware of it from very beginning (chance the TODO: > comment). Just, opt_case_dispatch impl is not complete _yet_, still > being faster by default by not using funcall dispatch. The TODO has nothing to do with this problem. It has worked one day on early version of 1.9, then matz has modified the class Symbol and brutally ruby failed because the optimisation was not removed > s = VM::InstructionSequence.new %{ > class Symbol > def === other > puts "foo" > end > end > case :s > when :s > end > } vgs% cat b.rb #!/usr/bin/ruby class Symbol def === other puts "foo" end end case :s when :s puts "s" end vgs% vgs% /usr/bin/ruby -v b.rb ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux] b.rb:3: warning: method redefined; discarding old === foo vgs% vgs% ./ruby -v b.rb ruby 1.9.0 (2008-04-01 revision 15881) [i686-linux] b.rb:3: warning: method redefined; discarding old === foo vgs% Guy Decoux