Fork me on GitHub
#clojure-spec
<
2017-06-14
>
souenzzo03:06:23

(s/def ::bar (s/cat :boo string?))
(s/def ::foo (s/cat :foo symbol? :bar ::bar))
This ::foo matches with (my-sym "my-string"). But I'm trying to match with (my-sym ("my-string")). How to describe?

madstap03:06:33

@souenzzo (s/def ::foo (s/cat :foo symbol? :bar (s/spec ::bar)))

seancorfield04:06:50

@souenzzo By way of explanation, s/cat -- as one of the "regex specs" -- combines with other regex specs by concatenation rather than nesting.

souenzzo04:06:37

seancorfield: I was not remembering/understanding the spec usage. 😄

odinodin14:06:20

Haven't pushed it yet, more of a proof of concept right now.

richiardiandrea14:06:20

I would be interested in checking, the last missing piece in tooling is something like that

odinodin15:06:04

Sure, I will push it some time this week

royalaid18:06:50

@odinodin Looks great! I would recommend looking at other kinds of error reporting that happens in other langs, I hear elm-lang has great error reporting, and I trying to get inspiration from something like that because I don’t think there is a real effort around making something like what you have.

odinodin18:06:41

Thanks for the tip, will do