Fork me on GitHub
#clojure-spec
<
2016-08-12
>
donaldball00:08:19

Curious if you could elaborate on why. I can see it being an impractical spec to validate outside of narrow test scenarios, but the documentation benefit seems worthwhile even so

Alex Miller (Clojure team)02:08:30

because spec is about data and atoms are about state

Alex Miller (Clojure team)02:08:30

it makes sense to me to spec the functions used to update an atom though

Alex Miller (Clojure team)02:08:57

this is just my own thoughts btw, not sure if rich or stu would agree so take it with that perspective

borkdude06:08:16

I guess people could use set-validator! with a normal spec? Does anyone ever use it?

mpenet06:08:06

I used to do exactly that with prismatic Schema. Works well

borkdude11:08:06

It's all so... composable

donaldball17:08:29

Am I… doing something wrong here?

donaldball17:08:33

(clojure.spec.gen/vector clojure.spec.gen/char-alphanumeric 5)
AssertionError Assert failed: First arg to vector must be a generator
(generator? generator)  clojure.test.check.generators/vector (generators.cljc:446)

donaldball17:08:06

sorry, I see now, these vars turned into fns, presumably to facilitate lazy-loading