My understanding is that s/form
is expected to return symbolic lists that can be passed to eval
. Forms of multi-spec specs don't behave that way, returning retag as evaluated value (e.g. a function instance).
(defn retag [x v]
(assoc (vec x) 0 v))
(defmulti command first)
(s/form (s/multi-spec command retag))
=> (clojure.spec.alpha/multi-spec
current.ns/command
#object[current.ns$retag 0x708d0436 current.ns$retag@708d0436])
;; should be something like
=> (clojure.spec.alpha/multi-spec
current.ns/command
current.ns/retag)