From: Lloyd Linklater Date: 2008-09-20T00:48:12+09:00 Subject: Re: Preserve insert order in a Hash Pe単a, Botp wrote: > From: Me Me [mailto:emanuelef@tiscali.it] > # I would like to know if it's possible to insert values in a Hash and > # then extract all of them in the same insertion order. > > only in ruby 1.9 Well, that is not *entirely* true. h={} p h h[1]=1 p h h[2]=1 p h h[3]=1 p h h p h h[1.5]=1 p h h p h h[0]=1 p h h p h yields: {} {1=>1} {1=>1, 2=>1} {1=>1, 2=>1, 3=>1} {1=>1, 2=>1, 3=>1} {1=>1, 2=>1, 3=>1, 1.5=>1} {1=>1, 2=>1, 3=>1, 1.5=>1} {1=>1, 2=>1, 3=>1, 1.5=>1, 0=>1} {1=>1, 2=>1, 3=>1, 1.5=>1, 0=>1} in JRUBY 1.1 which I am running on windows under netbeans. -- Posted via http://www.ruby-forum.com/.