On Fri, 23 Feb 2001, ts wrote:
> C> I think the problem is with the hashing algorithm. All array 
>  rb_ary_hash() I think
> C> methods which might invoke array hashing (basically &,|,uniq, 
> C> and hashing it self) hang (on my maschine) on self-referential
> C> (recursive) arrays.
>  Same problem with Array#eql?, Array#<=>
> pigeon%  ruby -e 'a = []; a << a; a.eql? a'
> -e:1:in `eql?': stack level too deep (SystemStackError)
>         from -e:1:in `eql?'
>         from -e:1:in `eql?'
>         from -e:1:in `eql?'

A similar problem is for loopless graphs. Try the following:

def f(x); [x,x]; end
def g(x); f f f f f f f f x; end
(g g g 1) == (g g g 1) #=> true

This seems normal, but it takes 33 million comparisons, even though each
side of the equality has only 25 objects !!! 

matju