clojure-spec

lilactown 2022-08-22T18:02:37.665349Z

is there a reason that there's no concrete Spec type/class? I have a desire to extend a library I'm writing to dispatch on whether a value is a reified spec value, and I can't easily do that without taking a dependency directly on clojure.spec.alpha

lilactown 2022-08-22T18:03:08.754649Z

i.e. the only way I can tell whether I've been passed a spec is by using s/spec?

Alex Miller (Clojure team) 2022-08-22T18:04:34.566869Z

It's not a type

Alex Miller (Clojure team) 2022-08-22T18:13:34.477419Z

You could dynamically load and resolve that function

lilactown 2022-08-22T18:22:41.222519Z

that doesn't work in CLJS

lilactown 2022-08-22T18:23:57.399789Z

in various places in clojure.spec.alpha an object is created via (reify Spec ,,,) and returned, which is what I want to extend the behavior of

lilactown 2022-08-22T18:27:19.425939Z

I don't care about the name, just wishing there was a concrete type I could extend

Alex Miller (Clojure team) 2022-08-22T18:49:44.026019Z

sets are also specs, and functions. there is not "one type" to check for

Alex Miller (Clojure team) 2022-08-22T18:53:58.255899Z

the behavior is defined via the protocol. things like with-gen are a good example of extending by wrapping. but maybe there is some better way to do what you need, not sure