Andy Fingerhut <andy_finger...@alum.wustl.edu> writes: > I don't know about using map, but here is a function inspired by one > called 'most' in Paul Graham's On Lisp. You could use (most fit-fn > (take k (shuffle popu))) in place of your (first ...) subexpression > above, and it would avoid sorting elements that you would otherwise > simply be throwing away anyway.
Unless I'm missing something 'most' is more or less the same thing as Clojure's 'max-key' function. The difference is that max-key takes the elements as arguments rather than the collection, so you'll need to 'apply' it to the collection: (apply max-key fit-fn (take k (shuffle pop)) -- 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