2009/7/24 Marcin G=F3rski <agormar / gmail.com>:
>> I don't think you're going to get it. In 1.8.7 hashes are by definition
>> unordered and the actual order is implementation-specific.
> Well I found information on JRuby 1.2 page:
> "A 1.8.6 compatible Ruby interpreter written in 100% pure Java."
> I think that Ruby 1.8.7 and 1.8.6 shouldn't differ very much.

Well they differ, although not in this regard. BUT

The point is than in Ruby < 1.9, there is no specified guarantee about
the order in which hashes enumerate their elements.

This means that you can't rely on a particular order, so even though
JRuby enumerates this particular hash in that order, and 1.8.7
enumerates in a different order, they both are compatible with the
documented behavior.


--=20
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale