From: "Radosław Bułat" Date: 2009-02-03T00:59:40+09:00 Subject: [ruby-core:21758] Re: [Feature #1084](Closed) request for: Array#sort_by! On Mon, Feb 2, 2009 at 3:30 PM, Florian Frank wrote: > I already asked in ruby-core:21318 and didn't get a reply, but what about > Hash#sort and Hash#sort_by or even the !-methods? With insertion-ordered hashes > returning hashes instead of arrays from these methods would now be semantically > useful. > On the one hand it would be nice to have these methods, on the other hand it would mean that Hash isn't anymore just simple, plain Hash (because the can be sorted and who knows what else will in the future). My pragmatic approach tells me that it's not as bad idea to have it. Without it if someone want to change order of keys he can do this by: h = {"b" => "bar", "a" => "foo"} h = Hash[*h.sort.flatten] p h -- Pozdrawiam Rados�aw Bu�at http://radarek.jogger.pl - m�j blog