Re:What Clojure Spec is and what you can do with it
by jmiskovic on Thursday September 10, 2020 @03:54PM
(#24435920)
Do you have to adapt spec definition to core.match somehow? Is there a resource to read more how to use them together?
[ Parent
| on HN ]
Re:What Clojure Spec is and what you can do with it
by stingraycharles on Friday September 11, 2020 @04:50AM
(#24440482)
No you don't have to do anything.
Let's say I have something like
(s/def :thespec (s/or :foo ::foo
:bar ::bar))
I can then use it in conjunction with core.match like (match [(s/conform :thespec val)]
[:foo x] (do-something-with x)
[:bar y] (do-something-else-with y))
Which imho is an easier way to navigate these things.