This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-26
Channels
- # 100-days-of-code (1)
- # aleph (4)
- # beginners (112)
- # boot (2)
- # business (4)
- # calva (3)
- # cider (37)
- # clara (26)
- # cljs-dev (6)
- # cljsrn (1)
- # clojars (4)
- # clojure (89)
- # clojure-brasil (1)
- # clojure-conj (1)
- # clojure-dev (81)
- # clojure-dusseldorf (8)
- # clojure-italy (41)
- # clojure-nl (3)
- # clojure-spec (11)
- # clojure-uk (14)
- # clojurescript (73)
- # cursive (1)
- # data-science (3)
- # datomic (2)
- # dirac (9)
- # duct (6)
- # emacs (4)
- # figwheel-main (1)
- # fulcro (47)
- # incanter (3)
- # jobs-discuss (43)
- # leiningen (18)
- # luminus (6)
- # lumo (4)
- # mount (4)
- # off-topic (31)
- # portkey (8)
- # protorepl (5)
- # re-frame (9)
- # reagent (15)
- # reitit (2)
- # ring-swagger (7)
- # shadow-cljs (28)
- # specter (4)
- # tools-deps (8)
- # uncomplicate (1)
If you’ve run into “Cannot convert path” errors with Expound (which happens if you use a spec with a conformer), please try out 0.7.2-SNAPSHOT and let me know what you think
Will try that out thanks a lot for the fix!
(s/fdef foo
:args (s/cat :n number?)
:ret string?)
(defn foo [n]
1)
(s/conform (:ret (s/get-spec `foo)) 1) ;; :clojure.spec.alpha/invalid
(s/assert (:ret (s/get-spec `foo)) 1) ;; 1
for debugging (and because I am lazy) I sometimes use s/assert*, it bypasses the various flags
why does stest/check
take symbols instead of vars? it doesn't require
code for you does it?
Hi there clojurians, I am looking for some help regarding the use of clojure.spec.alpha. Basically I would like to verify that a map of key-value pairs i receive as an argument is a sub set of a well defined group. For example let the group of valid keys be :key1 :key2. I would like my spec to conform if I get a map with en empty amount of keys, or with either :key1 exclusively or :key2 exclusively or both :key1 and :key2 exclusively. I’m confused about how to specify this