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 <redmine / ruby-lang.org> 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.