This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-02
Channels
- # announcements (2)
- # beginners (69)
- # boot (1)
- # cider (35)
- # clara (1)
- # cljs-dev (1)
- # clojure (40)
- # clojure-spec (11)
- # clojure-uk (8)
- # clojurescript (9)
- # cursive (1)
- # datomic (5)
- # figwheel-main (25)
- # fulcro (64)
- # jobs (2)
- # jukebox (1)
- # kaocha (3)
- # off-topic (7)
- # pathom (39)
- # planck (5)
- # random (1)
- # re-frame (11)
- # reagent (8)
- # shadow-cljs (58)
- # test-check (41)
- # vim (13)
running into issues with circular references between specs (::a references ::b in it’s definition and vice versa). taking a step back to consider alternative ways to model the specs, but will spec2 support referring to undefined specs? As in:
(s/def ::a ::b)
(s/def ::b <spec>)
Yes, and I have done some more work there to defer lookups more pervasively
I'd be nice to use s/assert
in production but if you s/assert
a spec that contains a fspec
, it will require test.check to check the value. Is is possible to disable this functionality in production but still use the s/assert
check?
How would it check the spec then @kenny?
(and you've got the same problem if you use s/valid?
or s/conform
, right?)
(s/valid? fn? thing)
If you want checks in production, put them in the code explicitly with s/valid?
and/or s/conform
.
Asserts in production are a code smell, IMO, since they throw an Error
, not an Exception
so you're basically going to "kill" your request/process.
If you want "Spec error messages" then you don't really want s/assert
-- you want explicit code to check validity and call explain
or something.