From: Tanaka Akira Date: 2009-08-07T02:28:24+09:00 Subject: [ruby-core:24804] Re: [Bug #1852] Enumerable's #hash Raises ArgumentError When Recursive Values are Present In article <67e307490908022024p6f7b753ej85cd46c61413523e@mail.gmail.com>, Run Paint Run Run writes: > What's more, the bug report that seemingly triggered this change was > not derived from a "real application". So why the uneven burden of > proof? As [ruby-core:24771] and [ruby-core:24773], Ruby 1.9.2 may break such application anyway even if #hash is not changed or #hash returns a constant because eql? is changed. There are incompatibility here anyway. > Again, all I'm asking for is an explanation of this change. It's hard > enough to spec trunk Ruby without seemingly arbitrary changes being > made "just because". :-/ 1.9.1's #hash is broken according to 1.9.2's #eql?. The exception "fix" it. Since cyclic data structure in hash key is rare, I think exception is not big problem. I guess the fix mentioned in [ruby-core:24761] may have some performance impact for usual non-cyclic hash key since all top-level #hash method call needs catch(). If the performance impact is small enough, no problem for the fix. -- Tanaka Akira