This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-29
Channels
- # beginners (24)
- # boot (6)
- # cider (22)
- # cljsjs (1)
- # cljsrn (12)
- # clojars (3)
- # clojure (170)
- # clojure-china (2)
- # clojure-dusseldorf (18)
- # clojure-finland (1)
- # clojure-italy (32)
- # clojure-nl (1)
- # clojure-russia (65)
- # clojure-sanfrancisco (1)
- # clojure-spec (21)
- # clojure-uk (46)
- # clojurescript (92)
- # clojutre (1)
- # clr (7)
- # cursive (7)
- # datomic (6)
- # dirac (49)
- # emacs (17)
- # events (1)
- # funcool (20)
- # hoplon (6)
- # job (1)
- # jobs (1)
- # keechma (2)
- # leiningen (6)
- # lumo (74)
- # off-topic (15)
- # om (7)
- # onyx (40)
- # overtone (4)
- # pedestal (8)
- # powderkeg (4)
- # proton (2)
- # protorepl (2)
- # re-frame (18)
- # reagent (24)
- # ring-swagger (3)
- # rum (15)
- # slack-help (1)
- # spacemacs (20)
- # uncomplicate (62)
- # unrepl (29)
- # untangled (10)
- # yada (10)
What’s the easiest way to make a spec that matches {:a 1 :b 1}
, {:a 1}
, and {:b 1}
, but not {}
?
is that regular or
or spec/or
?
ok, I got it. Thanks!
Is there a way to provide more detailed explain output for a custom conformer? In alpha15 I get a message like: val: "k" fails predicate: (conformer conform-int)
. I see I can supply an optional "unform", but no arity to supply an "explain"...
is there a way to turn off fdef validation for defn temporarily in -alpha14? I'm seeing a failure in a third party lib that works in another project.clj so I think I'm having classpath issues and I need to load the namespace so I can interogate some objects via the classloader
@manderson you can implement the Spec protocol to provide a custom explainer
if you look at the Spec implementations included in the lib (that are used for keys
and tuples, etc) you can get an idea of what kind of output they return
if errors, return a list of errors (like what you get from explain-data
), otherwise return empty list/nothing
Gotcha, thanks @hospadar. Figured that might be the only way, but was hoping for a "published" approach instead of looking behind the curtain. I'll give that a try.
@bja you can s/def your own spec over the top of the standard one
@alexmiller thanks. that's what I eventually settled on