2009/4/27 Christophe Grand <christo...@cgrand.net>: > > find-first-result is already in core: some
OH! yes :-$ > > 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)))) >> >> > > > -- > Professional: http://cgrand.net/ (fr) > On Clojure: http://clj-me.blogspot.com/ (en) > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---