From: Christian Neukirchen Date: 2005-12-15T02:20:14+09:00 Subject: Re: stable sort_by? Patrick Gundlach writes: > pp h.sort{ |a,b| > res = a[1][:a] <=> b[1][:a] > if res == 0 > res = a[1][:b] <=> b[1][:b] > end > if res == 0 > res = a[1][:c] <=> b[1][:c] > end > if res == 0 > res = a[1][:d] <=> b[1][:d] > end > res > }.reverse Checkout Numeric#nonzero?. > Patrick -- Christian Neukirchen http://chneukirchen.org