macro | previously cljs.spec/& | ![]() | Edit |
(& 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.
(defmacro &
[re & preds]
(let [pv (vec preds)]
`(amp-impl ~re '~(res &env re) ~pv '~(mapv #(res &env %) pv))))