Fork me on GitHub
#clojure-spec
<
2017-03-11
>
eggsyntax16:03:26

Anyone know offhand whether there's a way to set a random seed for gen/sample? I saw that you can do so in clojure.test.check/quick-check, but couldn't find mention of it re: sample and generate. I'd like to reproducibly generate some seed data.

eggsyntax16:03:34

Cool, thanks 🙂

eggsyntax16:03:19

Yeah, that should do me quite nicely.

gfredericks16:03:59

the test.check API was designed for reproducibility when running tests, not for ad-hoc generator use like spec seems to encourage

gfredericks16:03:15

adding an arity to gen/generate would presumably fix that

eggsyntax16:03:36

Yeah, that totally makes sense -- I just happen to be generating some seed data from a spec.

eggsyntax16:03:07

It's essentially a one-off, so I'm perfectly happy to abuse non-public API calls 😉