macro | previously cljs.spec/tuple | clojure.spec.alpha/tuple | Edit |
(tuple & preds)
takes one or more preds and returns a spec for a tuple, a vector where each element conforms to the corresponding pred. Each element will be referred to in paths using its ordinal.
(defmacro tuple
[& preds]
(clojure.core/assert (not (empty? preds)))
`(tuple-impl '~(mapv #(res &env %) preds) ~(vec preds)))