I found spec very useful and use it more and more. I'm looking forward to newer revisions, with support for optionality, it's been a big problem area in my case.<p>Here's a quick list of gotchas (well, they got me, so perhaps other people will find this list useful):<p>* `s/valid?` does not actually tell you that the data is valid<p>The naming of `s/valid?` suggests that you can call it on your data and find out if the data is valid according to the spec. This isn't true. What it actually tells you is if the data, <i>when conformed</i>, will be valid according to the spec.
If you pass the data as-is to your functions (without passing it through `s/conform`), you might find that they will be surprised at what they get.<p>* Conformers are likely not what you think. They are not intended for coercion and have many pitfalls (for example, multi-specs dispatch on unconformed value).<p>* s/merge doesn't necessarily do what you wanted if you're using conformers, only the last spec passed to merge will be used for s/conform (but you're not using conformers, right?)<p>* specs are checked eagerly. If you think that (s/valid? ::my-spec x) will only check ::my-spec, that is not the case. It will check any key of x found in the spec registry.<p>I settled on a subset of spec, because of the pitfalls.