From: Nobuyoshi Nakada Date: 2009-02-13T14:15:35+09:00 Subject: Re: Hash order (was: Re: If you are unhappy with the direction of Ruby 1.8.7+, respond) Hi, At Fri, 13 Feb 2009 09:16:39 +0900, James Coglan wrote in [ruby-talk:327995]: > I realise that there is no explicit iteration order specified for hashes in > 1.8. All I know is that this patch fixed by 1.8.7 bugs: > > http://github.com/jcoglan/packr/commit/9ece59428bbd1bfd497b45a2ae4de2d163a24849 > > Basically involves inserting keys in an explicit order rather than using > hash literals. This project uses a bunch of custom collection classes but > they're basically wrappers for arrays and hashes that merge array and hash > functionality into a single class. The constructors would iterate over the > hashes provided and insert values, and this insertion order changed in > 1.8.7. Hash in 1.8 doesn't define any kind of "order". It's definitely a bug in your code as you use the word "order". > I would concede that this is something of a grey area as it's neither a bug > fix or an explicit feature addition, but the question was asked about 1.8.6 > code that broke, and this is an example. I still have a regex-related bug in > this project that I've been unable to fix under 1.8.7. In fact, if anyone is > able to fix the last remaining test failure I'd be incredibly grateful. Could you post it in another thread? -- Nobu Nakada