clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
Petrus Theron 2020-10-02T09:08:47.049100Z

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}) .

alexmiller 2020-10-02T12:20:38.049900Z

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

Aron 2020-10-02T15:10:36.050600Z

How to have a generator that generates a constant string?

alexmiller 2020-10-02T15:16:09.051100Z

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

alexmiller 2020-10-02T15:17:30.051600Z

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

Aron 2020-10-02T15:23:53.052100Z

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

1😉