This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-13
Channels
- # beginners (28)
- # boot (3)
- # clara (9)
- # cljs-dev (127)
- # clojure (82)
- # clojure-belgium (3)
- # clojure-italy (7)
- # clojure-russia (2)
- # clojure-spec (4)
- # clojure-uk (2)
- # clojurescript (351)
- # data-science (3)
- # datascript (1)
- # datomic (24)
- # fulcro (15)
- # jobs (3)
- # juxt (16)
- # off-topic (2)
- # onyx (18)
- # parinfer (1)
- # pedestal (3)
- # perun (6)
- # re-frame (14)
- # spacemacs (20)
is there something out of the box for getting conforming subset of a data structure? e.g.
(s/def ::foo (s/keys :req-un [::a ::b]))
(s/valid? ::foo {:a 1 :b 2 :c 3}) ;; => true
(conformed-part ::foo {:a 1 :b 2 :c 3}) ;; => {:a 1 :b 2} (only keys from ::foo spec are kept)
in this case, the data structure does conform to the spec
because s/keys supports open maps
so, essentially no. there is something here Rich is considering adding but not sure if and when that will happen