From: Florian Frank Date: 2009-02-02T23:30:47+09:00 Subject: [ruby-core:21752] Re: [Feature #1084](Closed) request for: Array#sort_by! Eero Saynatkari wrote: > Excerpts from Kornelius Kalnbach's message of Mon Feb 02 13:32:33 +0200 2009: >> Eero Saynatkari wrote: >>> This seems to break expectations for Enumerable, since the >>> method cannot be reasonably supported there (and #sort_by >>> is still defined in Enumerable, as I understand it.) If it >>> is to remain, I think this should be specifically noted in >>> the documentation. Additionally, static as the Enumerable >>> inclusion may be, definining a method that depends on a >>> mixin seems a bit awkward: perhaps Array should define its >>> own #sort_by? >> matz only added Array#sort_by!. > > Exactly why I am asking :) > > > Eero > > -- > Magic is insufficiently advanced technology. > > 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. -- Florian Frank