From: Christoph Rippel Date: 2001-02-23T01:30:13+09:00 Subject: [ruby-talk:11326] Re: Array bugs? > -----Original Message----- > From: ts [mailto:decoux@moulon.inra.fr] > Sent: Thursday, February 22, 2001 07:10 AM > To: ruby-talk ML > Cc: ruby-talk@ruby-lang.org > Subject: [ruby-talk:11320] Re: Array bugs? > > > >>>>> "C" == Christoph Rippel writes: > > 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#<=> Actually #== and #- and #delete are effected too ... ruby -e 'a=[]; a << a; b = [] ; b << b; b == b' ruby -e 'a=[]; a << a; b = [] ; b << b; b.delete a' ruby -e 'a=[]; a << a; b = [] ; b << b; b - b' All these ruby methods in array.c are recursive. The same problem is probably also in hash - and it extends to arrays which contain object with non-id based #== methods. [...] Christoph