From: Bulat Ziganshin Date: 2003-01-13T16:30:43+09:00 Subject: Re: sorting with the Swartzian transform 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 :) MD> .map {|a| a[1]} MD> end MD> end and it's better to define standard (for 1.7) method sort_by after checking that it doesn't exist -- Best regards, Bulat mailto:bulatz@integ.ru