From: Zsban Ambrus Date: 2004-04-28T02:34:18+09:00 Subject: Re: Array#hash bug? You might count this as a bug, but it is documented. In ToDo of ruby-1.8.1, there is this line: - hash etc. should handle self referenceing array/hash On Wed, Apr 28, 2004 at 02:14:31AM +0900, Mark Hubbart wrote: > Hi, > I was messing around with recursive arrays and I came across this: > > mark@imac% cat hash.rb > a = [] > a[0] = a > puts a.hash > mark@imac% ruby -v hash.rb > ruby 1.9.0 (2004-04-11) [powerpc-darwin] > hash.rb:3:in `hash': stack level too deep (SystemStackError) > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > ... 44888 levels... > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3:in `hash' > from hash.rb:3 > > ... looks like a bug? > > cheers, > --Mark > ambrus