`every-pred` combines one or more predicates into a reusable conjunction. The returned function accepts zero or more values and returns `true` only when every predicate succeeds for every value. section 2.2.9
Its contract has a few useful edges:
- Each predicate must accept one argument. Predicate results use Clojure truthiness, but the combined result is always `true` or `false`. section 2.2.9
- Evaluation stops at the first `nil` or `false` result. With no values to test, the combined predicate returns `true`; calling `every-pred` with no predicates raises an `ArityException`. section 2.2.9
Combine checks for collection processing
`(remove (every-pred number? pos? odd?) (range 10))` yields `(0 2 4 6 8)`. Unlike `(and number? pos? odd?)`, which evaluates while forming the argument to `remove` and leaves only `odd?`, `every-pred` runs all three checks on each item. section 2.2.9
(defn symmetric? [xs]
(= (seq xs) (reverse xs)))
(def palindrome? ; #1
(every-pred some? string? not-empty symmetric?))
(defn palindromes [coll] ; #2
(filter palindrome? coll))
(palindromes ["a" nil :abba 1 "" "racecar" "abba" \a])
;; ("a" "racecar" "abba")
A reusable `palindrome?` combines non-nil, string, nonempty, and symmetry checks before `filter` selects matching values. section 2.2.9
Use `every?` to test one predicate across a collection; use `every-pred` when multiple predicates must all pass. For an alternative that succeeds when a check produces a truthy result, use `some-fn`. section 8.1.5 section 2.2.9
