From: sto.mar@... Date: 2012-10-21T22:08:00+09:00 Subject: Re: Hash with Integer key issue Am 21.10.2012 14:33, schrieb Brian Candler: > unknown wrote in post #1080538: >> Have you read the previous posts in this thread? >> The code above was given in reply to the OP's question, and it works >> as expected in Ruby 1.9.3 because hashes are indeed sorted there. > > FWIW, they are not sorted, but they do retain the original insertion > order. That's hair splitting... one can say they are sorted by insertion order, and in the considered example only that matters. > If you want a collection which is always sorted, then you need something > like a heap. Sigh... that's exactly my point, All I wanted to convey to the OP is that he most probably should *not* use a hash here. Maybe the problem here is that I'm not a native speaker. --