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? On Sep 25, 2:19 pm, Glen Rubin <[email protected]> wrote: > min-key looks good! thx guys!!! > > On Sep 25, 10:44 am, Nicolas Oury <[email protected]> wrote: > > > > > On Sat, Sep 25, 2010 at 3:40 PM, Jules <[email protected]> wrote: > > > Maybe this: (min-key #(abs (- % 136)) xs) > > > Wouldn't that be (apply min-key #(abs (- % 136)) xs)? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
