From: Dark Ambient Date: 2006-07-09T23:57:56+09:00 Subject: Re: Sorting arrays ------=_Part_129219_27637630.1152457071245 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/9/06, dblack@wobblini.net wrote: > > def sort(list) > sorted = [] > unsorted = [] > > lowest = nil > > list.each do |item| > puts "Comparing #{item.inspect} (item) to #{lowest.inspect} (lowest)" > if lowest == nil || item < lowest > puts "Either lowest is nil, or #{item.inspect} is less than #{ > lowest.inspect}" > puts "So lowest is now being set to #{item.inspect}" > lowest = item > end > end > > So the bottom line here is "anything" in the array (except perhaps for an > empty element) is less then nil ? That being the case I now understand how it's working, but don't understand nil, at least in the way it works in a comparison. Maybe it's just something I need to accept :) a < b , 3 < 5 , those all seem clear, even a < 1. oh well. Stuart ------=_Part_129219_27637630.1152457071245--