Fork me on GitHub
#clojure-spec
<
2017-11-11
>
qqq02:11:30

the problem with two specs is that in the case of maps, the key is used to pic, the spec for the value

qqq02:11:39

which mean the data 'decides' whether the check is recursive or non-recursive

seancorfield05:11:32

@qqq But that's exactly the point: with two separate specs you control whether the keys are deep or shallow -- assuming you have unqualified keys in the map and can use different namespace-qualifiers for shallow vs deep.

qqq05:11:57

@seancorfield: but I want to determine whether to make a shallo/dep check at the function call, not at the point when I construct the data

qqq05:11:32

I want a single piece of svg data in some functions, I want to make an expensive deep check taht it's an valid svg tree ikn other functions, I want to make a shallow check that "current node is good; we know nothing abut chiklren"

mattiasw09:11:29

I need just 1 running one call to the function to check at a time. Inside the function, there is a db call, so I need to run checking in single-thread, so (check 'test-many)doesn't work. I tried to use check-fn, but this doesn't even start calling the function. (stest/check-fn 'test-many (s/fspec :args (s/cat :samples (s/coll-of :hashdb.db.commands/data)) :ret nil?)) (I changed backquote to quote when publishing to slack.