(defn
multi-spec-impl
"Do not call this directly, use 'multi-spec'"
([form mmvar retag] (multi-spec-impl form mmvar retag nil))
([form mmvar retag gfn]
(let
[id
(random-uuid)
predx
(fn*
[p1__18555#]
(let
[mm @mmvar]
(c/and
(-get-method mm ((-dispatch-fn mm) p1__18555#))
(mm p1__18555#))))
dval
(fn* [p1__18556#] ((-dispatch-fn @mmvar) p1__18556#))
tag
(if
(keyword? retag)
(fn* [p1__18557# p2__18558#] (assoc p1__18557# retag p2__18558#))
retag)]
(reify
Specize
(specize* [s] s)
(specize* [s _] s)
Spec
(conform*
[_ x]
(if-let [pred (predx x)] (dt pred x form) :clojure.core/invalid))
(unform*
[_ x]
(if-let
[pred (predx x)]
(unform pred x)
(throw
(js/Error.
(str
"No method of: "
form
" for dispatch value: "
(dval x))))))
(explain*
[_ path via in x]
(let
[dv (dval x) path (conj path dv)]
(if-let
[pred (predx x)]
(explain-1 form pred path via in x)
[{:path path,
:pred form,
:val x,
:reason "no method",
:via via,
:in in}])))
(gen*
[_ overrides path rmap]
(if
gfn
(gfn)
(let
[gen
(fn
[[k f]]
(let
[p (f nil)]
(let
[rmap (inck rmap id)]
(when-not
(recur-limit? rmap id path k)
(gen/delay
(gen/fmap
(fn* [p1__18559#] (tag p1__18559# k))
(gensub
p
overrides
(conj path k)
rmap
(list 'method form k))))))))
gs
(->>
(methods @mmvar)
(remove (fn [[k]] (invalid? k)))
(map gen)
(remove nil?))]
(when (every? identity gs) (gen/one-of gs)))))
(with-gen* [_ gfn] (multi-spec-impl form mmvar retag gfn))
(describe*
[_]
(clojure.core/sequence
(clojure.core/seq
(clojure.core/concat
(clojure.core/list 'clojure.core/multi-spec)
(clojure.core/list form)
(clojure.core/list retag)))))))))