This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-11
Channels
- # arachne (5)
- # beginners (28)
- # boot (59)
- # cider (10)
- # cljs-dev (10)
- # cljsrn (10)
- # clojure (58)
- # clojure-brasil (2)
- # clojure-czech (9)
- # clojure-miami (1)
- # clojure-poland (2)
- # clojure-russia (12)
- # clojure-spec (16)
- # clojure-sweden (1)
- # clojure-taiwan (1)
- # clojure-uk (77)
- # clojurebridge (3)
- # clojurescript (108)
- # cursive (5)
- # datomic (25)
- # defnpodcast (2)
- # editors (1)
- # events (1)
- # funcool (24)
- # hoplon (37)
- # instaparse (1)
- # lein-figwheel (7)
- # leiningen (7)
- # luminus (3)
- # off-topic (9)
- # om (90)
- # onyx (88)
- # proton (3)
- # protorepl (9)
- # re-frame (30)
- # reagent (23)
- # rethinkdb (2)
- # untangled (33)
- # vim (1)
- # yada (6)
There is s/double-in with infinity and nan support
forgive the repost, folks, but i'm a little stumped 🙂
how do i specify that an optional set of keys must either appear together or not at all?
@robert-stuttaford: you can write your own predicate (-> (s/keys :opt [...]) (s/and #(every (partial contains? %) [...]))
true, thank you. i wonder if it's a use-case that has been considered by Rich et al?
Have you looked at the and/or support in s/keys :req?
was thinking something like (s/def ::combined (s/keys :req [(or (and ::a ::b) (and ::a ::b ::c ::d))]))
however b/c of open maps, I don’t think the latter two will fail as expected - for that you probably need and an additional pred
thanks Alex
I wonder if there’s a place for an s/xor
within the clojure.spec space where one, and only one, of the provided specs may conform, or if this can be concisely expressed with a combination of the existing features
Here’s a fun one. If I start up a repl and clojure.test/run-tests, everything is fine. If I lein test
, I get java.lang.Exception: :clojure.spec/unknown is not a fn, expected predicate fn
AFAIK, I’m not doing anything weird. Everything is required in the proper order, not using load
, etc
more weirdness: I run my tests from a repl, everything is fine. I run c.spec.tests/instrument
, run the same tests, and I get No implementation of method: :conform* of protocol: #'clojure.spec/Spec found for class: clojure.spec$spec_impl$reify__13372
. Reload all my source namespaces, everything works again
I have seen some stuff like this with mixture of aot and non aot on classpath