From: Nicholas Clare Date: 2007-05-05T21:31:14+09:00 Subject: Re: Hash order bug? ------=_Part_34474_16767398.1178368272219 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 5/5/07, Haoqi Haoqi wrote: > > > > Hashes are unordered. If you need an ordered collection, you'll need > > to use an array. > > > Hashes are unordered. that is how sadly for me,really! > > -- > Posted via http://www.ruby-forum.com/. > > Hi, I missed some of this thread, I only just joined the list. Although it's less than optimal, can you not just sort the keys when you need them. Something like: require 'enumerator' sorted_keys = hash.enum_for(:each_key).to_a.sort Again, there might very well be a better way to do even that, I'm new to ruby. Nick ------=_Part_34474_16767398.1178368272219--