Fork me on GitHub
#clojure-spec
<
2017-11-01
>
hkjels09:11:21

How do I get the merged form of a spec?

rickmoynihan12:11:16

Does clojure/spec have a predicate that matches g/simple-type?

rickmoynihan12:11:54

i.e. doesn’t match complex (collection) types

Alex Miller (Clojure team)14:11:27

no, but (def simple? (comp not coll?)) is a good first approximation

mpenet14:11:22

Or (complement coll?)

Alex Miller (Clojure team)14:11:21

well, mine was shorter :)

Alex Miller (Clojure team)14:11:42

“complement” is a long word :)

uwo20:11:16

am I right to understand that you can’t document keys with (s/keys :opt [::some-key]) without also providing the spec for ::some-key?

seancorfield20:11:59

It won't generate without a spec for ::some-key but it will validate just fine -- it will treat missing specs as any? I believe.

seancorfield20:11:26

^ @uwo is that the scenario you are asking about?

uwo21:11:18

@seancorfield yes! that’s the way I thought/hoped it worked, but I was calling s/assert in some clojurescript code and it was complaining about some keys that I had declared in s/keys, but that did not have their own spec.

ajs21:11:07

@alexmiller those were some meaningful tweets