Clojure: Testing every value from map operation for truth
- by Ralph
How can I test that every value in the collection returned by map is true?
I am using the following:
(defn test [f coll]
(every? #(identity %) (map f coll)))
with the anonymous function #(identity %), but I was wondering if there is a better way.
I cannot use (apply and ...) because and is a macro.
UPDATE: BTW, I am making my way through The Haskell Road to Logic, Maths, and Programming, by Kees Doets and Jan can Eijck, but doing the exercises in Clojure. It's a very interesting book.