From: James Coglan Date: 2009-02-14T01:17:29+09:00 Subject: Re: If you are unhappy with the direction of Ruby 1.8.7+, respond --000e0cd2457a2fd0f40462cf3198 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > > > 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. I'm really not up for a slanging match so let me just say that, in code I've written, Ruby < 1.8.7 has demonstrated the behaviour I described. This may be a fluke or a bug, in which case I will investigate further and file bugs if necessary. What I do know is that I've had code in a library released over 2 years ago and used by a fair number of people relying on this behaviour and heard no complaints until 1.8.7 arrived. I realise that hashtables are not ordered in 1.8 and have since made my code more robust. I'm not questioning your examples -- you can but experiment to see what works -- and I will try to extract the code from my project that demonstrates my point when I have some time. I'm not the least bit interested in who's right or wrong or in berating the Ruby code devs or indeed anyone else, and was hoping for a productive discussion, not people repeatedly asserting that I don't know how a hash table works and trying to shut me up. When I've time I'll see if what I have is a Ruby bug or something else. Until then I'm canning this conversation. --000e0cd2457a2fd0f40462cf3198--