Takes key+pred pairs, e.g. (s/cat :e even? :o odd?) Returns a regex op that matches (all) values in sequence, returning a map containing the keys of each pred and the corresponding value.
(require '[clojure.spec.alpha :as s]) (let [spec (s/cat :e even? :o odd?)] [(s/conform spec [22 11]) (s/conform spec [22]) (s/conform spec [22 11 22]) (s/conform spec 22) (s/conform spec "22")]) ;; => [{:e 22, :o 11} ;; :clojure.spec.alpha/invalid ;; :clojure.spec.alpha/invalid ;; :clojure.spec.alpha/invalid ;; :clojure.spec.alpha/invalid]
clojure.spec.alpha/cat
cat