Hi, I would like to extract a spec from a function spec (`s/fdef`). I realized since the spec is speccing an arglist this might be a bit challenging. Right now I wanted to extract the 2nd arg spec always. Context: https://github.com/WorksHub/leona/issues/4
(defn droid-resolver [ctx query value])
(s/def ::int int?)
(s/def ::string string?)
(s/def ::any any?)
(s/fdef droid-resolver
:args (s/cat :a ::int :b ::string :c ::any)
:ret ::int)
(let [[_ _ _ _ b-spec]
(s/form (:args (s/get-spec #'droid-resolver)))]
b-spec)
:leona.core-test/string
this would not fly would it? It would fail if someone defines a spec differently than cat ?
Yes, it would fail if that spec changed
There’s not really a way to get the spec of a specific arg like that
Ok thanks!