From: Tanaka Akira Date: 2009-08-02T14:07:59+09:00 Subject: [ruby-core:24682] Re: [Bug #1852] Enumerable's #hash Raises ArgumentError When Recursive Values are Present In article <67e307490908010125r6fa76654pa8e2224f714588fc@mail.gmail.com>, Run Paint Run Run writes: > Yes. Even if it simply returned a constant for the degenerate case. > (I'd rather a collision than an exception). To me, #hash is an > integral part of Ruby objects. Having it raise with specific instances > of a couple of classes just feels broken to me. > > Again, though, I'd prefer that the policy question be addressed before > a fix is determined. Is it desirable that recursive values be allowed > yet raise when standard methods are called on their container? I think #hash can return a constant value if * several real applications are found * O(n) behavior by constant hash value is not a problem for the applications * someone write a patch * the overhead of the patch is not a problem. Until above condition is met, I prefer the policy is undefined. -- Tanaka Akira