From: Run Paint Run Run Date: 2009-08-07T20:34:04+09:00 Subject: [ruby-core:24807] Re: [Bug #1852] Enumerable's #hash Raises ArgumentError When Recursive Values are Present Tanaka, Thank you for your explanation. :-) I haven't fully understood the issues involved yet, but assuming that we don't revert this commit... In the case of Hash, if recursive keys are to be prohibited, why don't methods like Hash#merge! also reject them? Hash values are still allowed to be recursive, but then #invert is fatal, as is #hash. It is most unorthodox for an object to be legally constructed yet refuse to compute a hash code. :-/ IOW, even if we do accept this fix, do we acknowledge that there's more work to be done here? > 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. If a fix for special case noticeably impacted performance for the general case, that would certainly be unacceptable. But at the moment we're just guessing. Would you be willing to try an implementation of Marc-Andre's idea? Then we'll have a better idea of what options are available. -- Run Paint Run Run