From: Robert Klemme Date: 2009-06-08T18:20:52+09:00 Subject: Re: How to sort array ascending, except zero ? 2009/6/8 Andrew Timberlake : > On Mon, Jun 8, 2009 at 10:40 AM, Paganoni wrote: >> Hello, I need to sort >> [1,4,2,0,8,9] to [1,2,4,8,9,0] >> >> A simple ascending sort but with the zero values to the end > Otherwise you want to override <=> on Fixnum Definitively not! Changing the default Fixnum ordering is dangerous because it will likely break a lot of other code and it is superfluous, too. There are better tools for that, i.e. defining the sort order in the place where it is needed (see Martin's solution). Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/