From: Jim Cochrane Date: 2006-07-26T08:15:08+09:00 Subject: Re: Hash order bug? On 2006-07-25, Nicolas Despr�s wrote: > On 7/25/06, Javier Valencia wrote: >> I have this piece of simple code: >> >> ---------------------------------------------- >> def foo >> return 5 >> end >> >> a = {:gr => false, :und => false, :det => true, :sta => false, :inv => >> false} >> puts a.inspect >> ---------------------------------------------- >> >> when I execute it i get a totally unordered hash: >> > > by definition a hash table is not ordered. Indeed. Here's one reference: http://en.wikipedia.org/wiki/Hash_table#Ordered_retrieval_issue I'm not sure I like the idea (discussed elsewhere in this thread) that the Hash class may be changed in the future to be ordered. --