Fork me on GitHub
#schema
<
2017-02-13
>
rb171914:02:59

In schema is there an or function. Say I wanted a positive integer and zero. For just a positive number I can do (s/defschema y (s/constrained s/Int pos?)) . If I then do (s/validate y 2) it works. But (s/validate y 0) fails. How can I extend my function y to 0 as well

metametadata15:02:01

@rb1719 how about (s/defschema y (s/constrained s/Int #(>= % 0)) ?