From: Yukihiro Matsumoto Date: 2009-09-15T02:51:30+09:00 Subject: [ruby-core:25594] Re: [Bug #1852] Enumerable's #hash Raises ArgumentError When Recursive Values are Present Hi, In message "Re: [ruby-core:25543] [Bug #1852] Enumerable's #hash Raises ArgumentError When Recursive Values are Present" on Sun, 13 Sep 2009 14:46:43 +0900, Marc-Andre Lafortune writes: |Here is a patch that provides a hash for recursive Array, Hash, Struct and Range. As discussed, there will be hash collisions when recursion is detected, although the hash of a recursive array with 1 element will be different from a recursive hash with 2 elements or from a recursive hash. | |This makes it possible to use recursive structures as keys. It also re-enables the other related functionalities (Array#-, Set, etc...) | |I have updated Rubyspecs to test for this, including some complex cases. | |Is this ok to be committed? Two points: * I prefer using rb_catch_obj(), instead of using TAG_THROW directly, unless using it hinders performance badly. * test suites (test/ruby/test_*.rb) should be updated as well (test_array.rb, test_thread.rb), when you check in the patch. matz.