From: Robert Klemme Date: 2007-11-14T00:38:47+09:00 Subject: Re: array ordering / selection according to elements - 2007/11/13, Shai Rosenfeld : > > given that time1 < time2 < time3 < time4 ... (and are all Time objects) > > myarray= [ time1, time2, time3, time4, time5 , time6 , time7 , .. ] > > special_sort(time4)= [ time3, time4, time5 ] > > ...basically, passing an arg of a certain obj in the array to a > "special_sort" func, how do i collect the "nearest" ones to it? thx for > any suggestions Define "nearest". What happens if time4 is not present in the array itself? etc. Cheers robert -- use.inject do |as, often| as.you_can - without end