This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-11
Channels
- # aws (6)
- # beginners (105)
- # boot (6)
- # cider (50)
- # cljsrn (10)
- # clojure (41)
- # clojure-brasil (6)
- # clojure-italy (25)
- # clojure-nl (17)
- # clojure-russia (4)
- # clojure-serbia (1)
- # clojure-spec (8)
- # clojure-uk (242)
- # clojurescript (27)
- # core-async (10)
- # cursive (5)
- # data-science (9)
- # datomic (43)
- # emacs (6)
- # fulcro (6)
- # graphql (1)
- # javascript (3)
- # juxt (4)
- # lein-figwheel (1)
- # mount (1)
- # onyx (19)
- # parinfer (2)
- # portkey (15)
- # protorepl (1)
- # re-frame (30)
- # reagent (3)
- # ring-swagger (1)
- # shadow-cljs (22)
- # sql (6)
- # tools-deps (23)
- # vim (13)
Anyone know why the default generator for (s/map-of keyword? string?)
would take 10+ seconds to generate 1,000 samples?
Ah, cool. I hadn't looked for that option in the spec fn itself. Thanks @ghadi.
I have this spec
(s/def ::foo (s/keys :req-un [::zipcode
::state
::bar
::baz]
And I’d like to force zipcode and state to be consistent (i have a zipcode->state
function so if they are both present, they need to match)
How can I write my ::zipcode
and ::state
specs?(s/def ::foo' (s/and ::foo (fn [{:keys [state zipcode]}] (= state (zipcode->state zipcode)))
wrap your ::foo in another spec that combines it with a custom predicate to ensure the zip code constraint