Re: clojure.spec and generic map with couple of special keys

2016-07-05 Thread Nikita Prokopov
That’s what I needed! Thanks On Tue, Jul 5, 2016 at 8:15 PM gsnewmark wrote: > If I'm not mistaken, similar issue was recently discussed on the > Clojurians Slack (direct link - > https://clojurians.slack.com/archives/clojure-spec/p146738221722 , > archive link - > https://clojurians-log.clo

Re: clojure.spec and generic map with couple of special keys

2016-07-05 Thread gsnewmark
If I'm not mistaken, similar issue was recently discussed on the Clojurians Slack (direct link - https://clojurians.slack.com/archives/clojure-spec/p146738221722 , archive link - https://clojurians-log.clojureverse.org/clojure-spec/2016-07-01.html - discussion starts from @ghadi's post at

Re: clojure.spec and generic map with couple of special keys

2016-07-05 Thread Sam Estep
I ran into this same issue while trying to spec Clojure's destructuring language. I asked a question about this on Stack Overflow: http://stackoverflow.com/q/38151446/5044950 On Tuesday, July 5, 2016 at 9:16:40 AM UTC-4, Nikita Prokopov wrote: > > Imagine I have a generic keyword => string map w

clojure.spec and generic map with couple of special keys

2016-07-05 Thread Nikita Prokopov
Imagine I have a generic keyword => string map with a special key that stores a number: { ::count 7 :x "x" :y "y" :z "z" ... } Both cases are easy to validate on their own: (s/def ::count number?) (s/conform (s/keys ::count) { ::count 7 }) (s/conform (s/map-of keyword? string?) { :x "x