On Mon, Apr 27, 2009 at 11:22 AM, Christophe Grand <christo...@cgrand.net> wrote: > > find-first-result is already in core: some
Ya know, I was considering not posting my code. But the thought did occur to me that someone might point out it wasn't necessary. Thanks! > Mark Volkmann a écrit : >> find-first in seq_utils returns the first item in a collection where >> (pred item) returns logical true. I needed a function that returns the >> result of (pred item) instead of item. This seems to do the trick. >> Maybe this should be added to seq_utils. >> >> (defn find-first-result [fn coll] >> (first (filter #(not (nil? %)) (map fn coll)))) -- R. Mark Volkmann Object Computing, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---