This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-18
Channels
- # aleph (59)
- # beginners (21)
- # bigdata (1)
- # boot (110)
- # cider (7)
- # clara (1)
- # cljs-dev (160)
- # cljsjs (3)
- # clojars (10)
- # clojure (122)
- # clojure-czech (2)
- # clojure-dusseldorf (5)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-korea (5)
- # clojure-russia (13)
- # clojure-spec (15)
- # clojure-uk (78)
- # clojurebridge (1)
- # clojurescript (196)
- # core-async (6)
- # core-logic (27)
- # cursive (11)
- # data-science (2)
- # datomic (45)
- # dirac (9)
- # emacs (2)
- # funcool (8)
- # hoplon (16)
- # immutant (13)
- # jobs (1)
- # klipse (11)
- # lein-figwheel (1)
- # leiningen (1)
- # off-topic (3)
- # om (40)
- # onyx (31)
- # pedestal (25)
- # re-frame (55)
- # ring (1)
- # ring-swagger (1)
- # rum (4)
- # specter (1)
- # sql (2)
- # untangled (30)
- # vim (12)
- # yada (12)
For example (s/form (s/every string?)) => (clojure.spec/every string? ...) (s/form (s/tuple string?)) => (clojure.spec/tuple clojure.core/string?)
No and I am working on fixing all of those right now
This particular one is http://dev.clojure.org/jira/browse/CLJ-2035
Has anyone used clojure.spec at runtime, e.g. to validate the arguments of fns at system boundaries?
Yes, that’s how we use it @donaldball
What’s your technique? Do you instrument the namespaces or fns about which you care, or manually check the args using a precondition or e.g. a custom defn
macro?
@decoursin do that with instrument
prior to the call to check
@donaldball We explicitly call conform
and see whether we get invalid?
data back, since we need to map to a set of known error codes that our API returns.
In a couple of places we use explain-data
to help figure out which error code to return (but most are simply "parameter X was not valid").
Most of our specs are data structure specs. We have some function specs. We call instrument
when we’re testing, and we have a few places where we run check
explicitly as well. Mostly we’ve been doing the latter manually (in the REPL) so far.