This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-03
Channels
- # boot-dev (1)
- # cider (27)
- # cljsjs (6)
- # cljsrn (11)
- # clojure (249)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-greece (1)
- # clojure-italy (28)
- # clojure-nl (12)
- # clojure-russia (2)
- # clojure-spec (5)
- # clojure-uk (27)
- # clojurescript (24)
- # clojutre (2)
- # component (8)
- # cryogen (1)
- # cursive (7)
- # datomic (61)
- # editors (18)
- # emacs (1)
- # events (1)
- # figwheel (4)
- # fulcro (35)
- # graphql (4)
- # jobs (3)
- # jobs-rus (1)
- # keechma (1)
- # leiningen (1)
- # london-clojurians (1)
- # luminus (62)
- # off-topic (154)
- # onyx (23)
- # pedestal (43)
- # portkey (66)
- # re-frame (49)
- # reagent (23)
- # shadow-cljs (92)
- # tools-deps (113)
- # uncomplicate (2)
Let me post my twitter question here as well 🙂 > Clojure library writers, what's your position on spec asserts? Leave it to library consumers to set, leaving it to calling code to> choose whether to assert or not, or enforcing it from the library to ensure malformed payloads always throw?
do you mean using spec.alpha/assert
?
probably wouldn’t use that in a library, I’d rely on instrument during dev/test. if you’ve got data coming in that must be validated (say user input or stuff coming in over a network) then you do an unconditional (when-not (s/valid ..) (throw …))
note that assert
can be turned off by changing *compile-asserts*
and you wouldn’t want that for stuf that must be checked.