From: E F van de Laar Date: 2003-01-24T11:37:52+09:00 Subject: Bug concerning 1.6.8 and hash equality? I think I may have stumbled upon a bug in Ruby version 1.6.8. This issue arose by a unit test comparing the equality of different types of hashes. At first I thought the default behavior of 1.6.8 was correct; hashes with equal keys and values are equal when compared with "==" and are not equal if one of those hashes has been instantiated with a default value; in my case an empty array. In version 1.6.7 and 1.8.0-pre this behavior differs and both cases evaluate as true. An example should make this all clear. :) emiel@chyrellos:/usr/local/ruby-1.6.8/bin$ ./irb irb(main):001:0> a = Hash.new [] => {} irb(main):002:0> b = {} => {} irb(main):003:0> a == b => false irb(main):004:0> p RUBY_VERSION "1.6.8" => nil The question is which is the correct behavior? Personally I believe the behavior of 1.6.7 is correct; a hash is a hash no matter which default value it carries. Emiel -- E F van de Laar +31648183479 www.il.fontys.nl/~emiel