From: Intransition Date: 2011-07-15T11:09:42+09:00 Subject: Re: does OrderedHash exist? On Jul 14, 6:36 pm, Alexey Muranov wrote: > Kendall Gifford wrote in post #1010836: > > > If I were you I'd go ask the guys in the "Ruby > > on > > Rails: Core" mailing-list/group ( > >https://groups.google.com/forum/#!forum/rubyonrails-core) if you can > > expect > > the class to stick around (and/or why it's been nodoc-ed). After all, > > since > > your project is a rails one you're right to look to leverage this > > ActiveSupport class. > > Thanks Gifford, i didn't know about this mailing list. > > > > >> I think by the way that the current ordered implementation of Hash is > >> nice, but should have been called OrderedHash, so that in future > >> versions Hash could be made unordered again. > > > Or it is named correctly and you can just assume a Hash isn't ordered > > (even > > if it is for a specific version) and code accordingly. > > Yes, my "problem" is exactly that i did not want to assume Hash to be > ordered. Insertion ordered is part of Ruby spec now. It is very unlikely to change b/c a lot of people will be very pissed. That said, there are other types of order. Consider hashery gem with it's Dictionary class (which is an evolution of the orderedhash gem).