From: Minero Aoki Date: 1999-03-24T19:51:30+09:00 Subject: [ruby-dev:6485] [bug] same 'hash' value あおきです。 1.3になってから、同じhashを持つキーが複数ある場合のHashの 動作がおかしくなっています。 [再現スクリプト] class A attr :a def hash() 1 end def eql?( ot ) puts 'eql?' A === ot and ot.a == @a end def to_s() @a end def initialize( v ) @a = v end end hsh = { A.new(1) => 1, A.new(2) => 2, A.new(3) => 3 } puts hsh[ A.new(1) ] puts hsh[ A.new(2) ] puts hsh[ A.new(3) ] v 1.2.3 の実行結果 eql? eql? eql? eql? eql? eql? 1 eql? eql? 2 eql? 3 v 1.3.1(19990315) の実行結果 3 3 3 パッチをつけられるといいんですが理解不足のためできません… (__;; すみませんがよろしくお願いします。 ------------------------------------------------------------------- あおきみねろう mail: aamine@dp.u-netsurf.ne.jp site: http://www1.u-netsurf.ne.jp/~brew/mine/