From: Tanaka Akira Date: 2009-02-14T00:50:03+09:00 Subject: Re: If you are unhappy with the direction of Ruby 1.8.7+, respond In article , James Coglan writes: > Regardless of whether they're *supposed* to, the Rubies I've used before > 1.8.7 actually do iterate in insertion order. Could be machine/OS specific, > a fluke, whatever. The point is that 1.8.7 definitely does not iterate in > the order that keys appear in a literal, at least on my machine. If this is > supposed to now be defined behaviour I'll investigate further and file a bug > if necessary. Would you show us an example which the insertion order is preserved on 1.8.6 and not preserved on 1.8.7? I tested as follows. The order is changed since 1.9. 1.8.7 is same as 1.8.6 and older. % all-ruby -e 'h = {2=>"b", 1=>"a"}; p h' ruby-1.4.6(2000-08-16) {1=>"a", 2=>"b"} ruby-1.6.0(2000-09-19) {1=>"a", 2=>"b"} ruby-1.6.1(2000-09-27) {1=>"a", 2=>"b"} ruby-1.6.2(2000-12-25) {1=>"a", 2=>"b"} ruby-1.6.3(2001-03-19) {1=>"a", 2=>"b"} ruby-1.6.4(2001-06-04) {1=>"a", 2=>"b"} ruby-1.6.5(2001-09-19) {1=>"a", 2=>"b"} ruby-1.6.6(2001-12-26) {1=>"a", 2=>"b"} ruby-1.6.7(2002-03-01) {1=>"a", 2=>"b"} ruby-1.6.8(2002-12-24) {1=>"a", 2=>"b"} ruby-1.8.0(2003-08-04) {1=>"a", 2=>"b"} ruby-1.8.1(2003-12-25) {1=>"a", 2=>"b"} ruby-1.8.2(2004-12-25) {1=>"a", 2=>"b"} ruby-1.8.3(2005-09-21) {1=>"a", 2=>"b"} ruby-1.8.4(2005-12-24) {1=>"a", 2=>"b"} ruby-1.8.5(2006-08-25) {1=>"a", 2=>"b"} ruby-1.8.5p52(2007-06-07) {1=>"a", 2=>"b"} ruby-1.8.5p113(2007-09-23) {1=>"a", 2=>"b"} ruby-1.8.5p115(2008-03-03) {1=>"a", 2=>"b"} ruby-1.8.5p231(2008-06-20) {1=>"a", 2=>"b"} ruby-1.8.5head(2008-06-20p231) {1=>"a", 2=>"b"} ruby-1.8.6p0(2007-03-13) {1=>"a", 2=>"b"} ruby-1.8.6p36(2007-06-07) {1=>"a", 2=>"b"} ruby-1.8.6p110(2007-09-23) {1=>"a", 2=>"b"} ruby-1.8.6p111(2007-09-24) {1=>"a", 2=>"b"} ruby-1.8.6p114(2008-03-03) {1=>"a", 2=>"b"} ruby-1.8.6p230(2008-06-20) {1=>"a", 2=>"b"} ruby-1.8.6p287(2008-08-11) {1=>"a", 2=>"b"} ruby-1.8.6head(2009-02-13p330) {1=>"a", 2=>"b"} ruby-1.8.7p0(2008-05-31) {1=>"a", 2=>"b"} ruby-1.8.7p17(2008-06-09) {1=>"a", 2=>"b"} ruby-1.8.7p22(2008-06-20) {1=>"a", 2=>"b"} ruby-1.8.7p72(2008-08-11) {1=>"a", 2=>"b"} ruby-1.8.7head(2009-02-13p116) {1=>"a", 2=>"b"} ruby-1.8(2009-02-05r22080) {1=>"a", 2=>"b"} ruby-1.9.1p0(2009-01-30r21907) {2=>"b", 1=>"a"} ruby-1.9(2009-02-11r22240) {2=>"b", 1=>"a"} -- Tanaka Akira