Fork me on GitHub
#clojure-spec
<
2018-01-23
>
stathissideris12:01:09

here’s a tricky one: I have a data structure and I use conform with a regex spec to extract information from it. If the data structure is invalid in two places, I only get the first problem reported, because the regex stops. Is there any way to get the second problem too? (I suspect it’s a no)

Alex Miller (Clojure team)13:01:03

To get a deeper level for something like this you would really need to write your own custom spec

stathissideris13:01:07

@alexmiller ok, makes sense, thanks. I’ll see if I can circumvent the problem somehow

vikeri15:01:26

Is there any way of making sure that the specs I write point to other specs? I can write (s/def ::my-spec (s/keys [:not-a-spec/key]) And :not-a-spec/key doesn’t have to be a spec. Can I somehow enforce that it really is a spec that it’s pointing to?

vikeri16:01:36

Also, if I could somehow avoid defining specs twice that would be fantastic

stathissideris16:01:58

why do you have to define them twice?