This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-27
Channels
- # adventofcode (1)
- # announcements (4)
- # beginners (120)
- # calva (5)
- # cider (12)
- # clara (3)
- # cljdoc (48)
- # cljs-dev (33)
- # cljsrn (4)
- # clojure (124)
- # clojure-dev (43)
- # clojure-europe (2)
- # clojure-italy (168)
- # clojure-nl (2)
- # clojure-spec (7)
- # clojure-uk (79)
- # clojurescript (50)
- # core-logic (6)
- # cursive (12)
- # datascript (1)
- # datomic (8)
- # devcards (2)
- # emacs (5)
- # events (2)
- # figwheel-main (6)
- # fulcro (18)
- # graphql (42)
- # hyperfiddle (3)
- # jobs (1)
- # luminus (2)
- # nrepl (5)
- # off-topic (59)
- # onyx (5)
- # parinfer (2)
- # pathom (10)
- # pedestal (2)
- # portkey (3)
- # re-frame (24)
- # reagent (6)
- # reitit (54)
- # remote-jobs (1)
- # ring (5)
- # shadow-cljs (75)
- # spacemacs (35)
- # sql (22)
- # tools-deps (16)
- # unrepl (10)
hello folks, it there a predicate for non-nil?
I want to make sure that the key is there but it is not nil
and I don't care about the value - can't use any?
basically
right 😄
just checking it out locally b/c I’ve never tried using some?
for a spec:
(gen/sample (s/gen some?))
=> (() #{} . {} \8 {} {} [] [y5/S? false 5] :k-)
and of course the built-in generators for any?
and some?
are very similar https://github.com/clojure/spec.alpha/blob/31165fec69ff86129a1ada8b3f50864922dfc88a/src/main/clojure/clojure/spec/gen/alpha.clj#L135-L136
Is there a way to separate the spec of the structure of a data structure from the spec of the data, and allow different "models" to be used in different circumstances? I.e. have a :usergroup {::meetingpoint {...} ::users [{::address ... ::name ...} ...]}
(with (s/def ::users (s/* ::user)
) for the geo routing part of my application, but ::user {::email ... ::name ...}
for the messaging part of my application, but let both parts share the non-structural specs of ::user
's data? I.e. can I tell spec "validate this map with structural information X ... switch to a different component of my app ... now validate the same map with structural information Y", with both X and Y using the same leafs and the map being the same, using the same keywords as keys, just the structure being different? (Following up on @stijn's question from earlier and my own discussion with @orestis in #graphql.)