From: Stefan Lang Date: 2009-02-14T00:59:09+09:00 Subject: Re: If you are unhappy with the direction of Ruby 1.8.7+, respond 2009/2/13 James Coglan : >> >> >>> 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 >> :-) > > > > Regardless of whether they're *supposed* to, the Rubies I've used before > 1.8.7 actually do iterate in insertion order. NO THEY DO NOT. It is the nature of a regular hashtable that the order of entries in its internal data structures depends only on the hash function and its inputs. It doesn't know anything about the order of entries in your hash literal. I've shown you examples using Ruby *1.8.6* that clearly demonstrate that it gives a **** about order of appearance in a literal, or insertion order. Stefan