From: James Britt Date: 2004-09-04T12:45:31+09:00 Subject: Re: Hashes and ordering Markus wrote: > To see why this seems odd, let me recast your question in terms of > arrays: > > > Does anyone depend on these arrays being equal? > > x = Array.new; x[1] = 2; x[3] = 4 > y = Array.new; y[3] = 4; y[1] = 2 > x == y # => true > > Or does anyone have code that depends in some other way on the fact that > the order in which items are added too an array is NOT significant? > > This seems like apples and oranges. One definition of an array is that it's a contiguous series of memory storage locations; people take for granted that order doesn't matter. Change this and it's not an array any more. But with hashes, allowing two hashes to have some notion of equality by virtue of having the exact same key/value pairs does not conflict with the essential behavior of a hash. James