Fork me on GitHub
#clojure-spec
<
2020-10-02
>
braai engineer09:10:47

Where do I file Spec2 bug reports? (let [charset #{\a \b \c}] (s/+ charset)) throws :

Execution error (IllegalArgumentException) at clojure.alpha.spec/resolve-spec (spec.clj:219).
Symbolic spec must be fully-qualified: charset
However moving the set to a separate namespace or passing it in directly works, e.g.: (s/+ #{\a \b \c}) .

Alex Miller (Clojure team)12:10:38

This is expected behavior - there are some changes due to symbolic specs

Aron15:10:36

How to have a generator that generates a constant string?

Alex Miller (Clojure team)15:10:09

assuming you're talking spec 1, you can pull a generator from a set of one thing

Alex Miller (Clojure team)15:10:30

(gen/sample (s/gen #{"a string"}))

Aron15:10:53

thanks. Yeah, I was told not to use spec2 in production by someone

😉 3