Hi, I have just filed this bug on CodePlex: http://ironruby.codeplex.com/WorkItem/View.aspx?Wo... It is actually pretty easy to fix with a bunch of lines of code in RubyArray.GetHashCode (just tested, too bad IronRuby.dll is not open to contributions) and, as a result, this would resolve the following 4 critical failures for the array core specs: Array#hash properly handles recursive arrays Array#| properly handles recursive arrays Array#uniq properly handles recursive arrays Array#uniq! properly handles recursive arrays Regards -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN
on 2009-04-16 23:22
on 2009-04-17 00:09
I can fix RubyArray.GetHashCode to handle the simple case of an array containing itself. However, the simple fix wont deal with the case where the array is indirectly recursive as in this snippet. a =  b = [a] a<<b
on 2009-04-17 00:24
Curt pointed out a way to fix the recursive case using RubyUtils.RecursionTracker...
on 2009-04-17 00:30
Great, that's exactly what I used :-) Thanks On Fri, Apr 17, 2009 at 00:22, Shri Borde <Shri.Borde@microsoft.com> wrote: > However, the simple fix wont deal with the case where the array is indirectly recursive as in this snippet. > Hi, > Array#| properly handles recursive arrays > Ironruby-core mailing list > Ironrubyfirstname.lastname@example.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Daniele Alessandri http://www.clorophilla.net/blog/ http://twitter.com/JoL1hAHN
on 2009-04-17 01:15
Does Ruby call "hash" dynamically on each element of the array? If not then there is no need for RecursionTracker. A simple non-recursive DFS with a dictionary that remembers visited objects should do. Tomas
on 2009-04-17 01:16
See RubyFileOps.Join for an example. Tomas
on 2009-04-17 04:01
The simple test I did suggested that MRI dynamically calls hash on each element of the array.