From: "Hal E. Fulton" Date: 2003-01-14T02:03:48+09:00 Subject: Re: sorting with the Swartzian transform ----- Original Message ----- From: "Daniel Carrera" To: "ruby-talk ML" Sent: Monday, January 13, 2003 10:30 AM Subject: Re: sorting with the Swartzian transform > On Mon, 13 Jan 2003, Bulat Ziganshin wrote: > > > Hello Martin, > > > > Sunday, January 12, 2003, 11:48:27 AM, you wrote: > > > > MD> class Array > > MD> def ssort(&block) > > MD> map {{|i| [&block.call(i), i]}\ > > MD> .sort {|a,b| a[0] <=> b[0]}\ > > > > just ".sort" will be faster (in most cases :) > > Yes, but it does something different. '.sort' sorts in ASCIIbetical > order (so 10 comes before 2) , whereas <=> is a numerical sort. What are you talking about? I think you're confused, but if not, please illustrate with code. Hal