yes correct. but i can write a fn to determine the index of the minimum distance in my new list?
that index applied to my original list will give me the value back. and this still would involve fewer calculations i think. On Sep 27, 10:50 am, Michael Gardner <gardne...@gmail.com> wrote: > On Sep 27, 2010, at 9:28 AM, Glen Rubin wrote: > > > It occurs to me that another way of doing this is to map a new list > > and then use the min fn. something like: > > > (apply min (map #(Math/abs (- % 136)) xs)) > > > maybe this is better and involves less calculations? > > That gives you the minimum distance from 136, not the value itself. You can't > get back the original value afterwards either, because you don't know whether > to subtract or add the distance from 136. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en