From: Wayne Scott Date: 2001-05-17T07:47:36+09:00 Subject: [ruby-talk:15319] Re: Pluggable sorting - How would you do it? From: matz@zetabits.com (Yukihiro Matsumoto) > It implements Schwartzian transformation inside. I like this idea, > but am not yet sure "sort_by" is a proper name for the behavior. How about "sort_using" ?? BTW I have noticed that sorting on multiple fields feels clumsy in Ruby. tbl.sort! do |a,b| r = b[0] <=> a[0] r = a[1] <=> b[1] unless r.nonzero? r end vs sort {$b->[0] <=> $a->[0] || $a->[1] <=> $b->[1]} @tbl; in perl. You get bitten by the fact that 0 does not evaluate to false in ruby. Of course I might just be too comfortable with perl. -Wayne