From: "Mark J. Reed" Date: 2003-09-17T23:37:11+09:00 Subject: Re: What's New and Shiny in Ruby 1.8.0? On Thu, Aug 07, 2003 at 01:35:40AM +0900, Brett H. Williams wrote: > On Aug 6, Harry Ohlsen wrote: > > sorted = people.sort_by { |p| [p.last_name, p.first_name, p.salary] } > > I really like this. But is there a simple easy way to get a descending > sort here without reverting to sorted = people.sort { ... } ? How about sorted = people.sort_by { |p| [p.last_name, p.first_name, p.salary] }.reverse I haven't looked, but I suspect you can't selectively make individual criteria ascending/descending. Now, if we had a #stable_sort_by, then we could chain them together to get the desired results without crafting complex comparisons . . . :) -Mark