Fork me on GitHub
#clojure-spec
<
2016-08-05
>
lvh02:08:59

@gfredericks: You saw the PR I put up for schpec a few days ago, right? I’d like to contribute all 3 things I have tickets open for, but I’d prefer to do them sequentially for minimal git exposure

gfredericks02:08:44

@lvh yep, I just didn't have any free time the last week; I think this weekend is promising

gfredericks02:08:05

I can probably turn them into a proper release

lvh02:08:01

sure, no problem 🙂 not complaining, just wanted to make sure you knew it existed

lvh02:08:12

I will be in Seoul next week with mixed amounts of time available on this

kurt-yagram10:08:20

Hey, would it be considered bad practice to put spec/def inside a top-level let?

mpenet10:08:54

I think so yes, if you need let scoped specs you can use s/spec I think

mpenet10:08:27

s/def mutates the spec registry so a bit hairy in a let imho

kurt-yagram10:08:59

alright... thx

glv13:08:00

Just curious … what would you be defining in the let that the spec would need? I can see maybe putting it in a letfn if you needed a particularly hairy :fn and wanted to compose it from smaller pieces …

mpenet15:08:24

(s/def ::something (letfn [(yourpred? [x[ ...) (yourgen? [] ...)] (s/spec yourpred? :gen yourgen?)) is nice also for the explain

mpenet15:08:54

at least it shows something more meaningful than an anonymous fn

glv15:08:31

Yep, you could put the letfn either place.

donaldball16:08:17

I’ve been using that pattern like it’s going out of style for my specs of e.g. maps with dependent values

donaldball16:08:14

Has anyone been able to articulate a reason for or work around the MultiFn errors that often occur when running stest/check?

donaldball16:08:22

E.g.

CompilerException java.lang.ClassCastException: cider.nrepl.middleware.test$report cannot be cast to clojure.lang.MultiFn, compiling:(clojure/test/check/clojure_test.cljc:95:1) 

gfredericks16:08:08

@donaldball: yes, you just have to explicitly require clojure.test.check.clojure-test

donaldball16:08:45

Awesome, thanks

donaldball16:08:56

Alas, I still get that exception

Alex Miller (Clojure team)17:08:40

@donaldball I think I added the lein workaround as a comment there to turn off clojure.test monkeypatching

donaldball19:08:44

FWIW the lein workaround is sufficient to get lein test to not barf, but I needed to explicitly require clojure.test.check.clojure-test in my test namespaces for the check to work in my cider repl

gfredericks19:08:21

I'll take this as more evidence that a test.check release would be helpful