ClojureDocs

Nav

Namespaces

&

  • (& re & preds)
takes a regex op re, and predicates. Returns a regex-op that consumes
input as per re but subjects the resulting value to the
conjunction of the predicates, and any conforming they might perform.
1 Example
(require '[clojure.spec.alpha :as s])

(s/conform
  (s/cat :tag keyword? :children (s/& (s/+ integer?) #(-> % count (>= 2))))
  [:a 3])
;=> :clojure.spec.alpha/invalid
(s/conform
  (s/cat :tag keyword? :children (s/& (s/+ integer?) #(-> % count (>= 2))))
  [:a 3 4 5])
;=> {:tag :a, :children [3 4 5]}
See Also
No see-alsos for clojure.spec.alpha/&
0 Notes
No notes for &