Hi --

On Sat, 14 Feb 2009, James Coglan wrote:

> 2009/2/13 David A. Black <dblack / rubypal.com>
>
>> Hi --
>>
>> On Sat, 14 Feb 2009, Rick DeNatale wrote:
>>
>>  Sometime after that discussion, Matz, who I know has much more than a
>>> basic
>>> understanding of hash-tables, decided that, yes,
>>> defining the iteration order of Ruby hashes to  be by insertion order, and
>>> that this was easily done with minimal impact to performance/space
>>> requirements by linking buckets in the internal hash table used to
>>> IMPLEMENT
>>> Hash, and made this change in Ruby 1.9, which has been backported to Ruby
>>> 1.8.7.
>>>
>>
>> Hashes aren't ordered in 1.8.7, though.
>
>
> Seconded -- 1.8.7 is precisely where my code that was relying on insertion
> order *does not work*. Actually let me be more specific. My code was relying
> on keys being inserted in the order they appear in a hash literal, and on
> subsequent iteration occuring in the same order.

That doesn't happen in any 1.8 version, though. (Sorry; I feel like
something's going right past me, and I'll stop after this iteration
:-)


David

-- 
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)

http://www.wishsight.com => Independent, social wishlist management!