This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-08
Channels
- # aws (4)
- # beginners (81)
- # boot (65)
- # cljs-dev (10)
- # cljsjs (1)
- # cljsrn (12)
- # clojure (26)
- # clojure-austin (2)
- # clojure-dusseldorf (2)
- # clojure-russia (123)
- # clojure-spec (23)
- # clojure-uk (12)
- # clojurescript (36)
- # cursive (11)
- # datomic (39)
- # events (1)
- # hoplon (25)
- # incanter (4)
- # leiningen (3)
- # off-topic (5)
- # om (31)
- # re-frame (24)
- # reagent (13)
- # ring-swagger (2)
- # rum (10)
- # untangled (3)
- # yada (10)
I'm a bit surprised that :clojure.core.specs/seq-binding-form
doesn't restrict itself to only acceting vectors, i.e. you can attempt to destructure {(foo) :something}
and it fails on because of an assert
in clojure.core/destructuring
rather than doing so at the spec level
@alexmiller in your recent article on the destructuring spec you mention
> Rather than recursively parsing the binding form, we could simply conform it to receive a more regular structure described in terms of the parts we've defined in the spec.
…but that’s not entirely true because the use of every
would prevent conform
to recur to deeper levels to find the ::binding-form
used within ::map-binding
for example. Right?
anyone toyed with https://github.com/uswitch/speculate ?
so, i was under the impression that fdef
instruments a function and ensures that its args and return values conform to the spec on all invocations, but i think i’m wrong
for what it’s worth, i’m porting a schema-based codebase to spec, and want something similar to schema’s ^:always-validate
instrument is a dev time thing really (it can trigger gen). To get ret validation you need to call check
https://clojure.github.io/clojure/branch-master/clojure.spec-api.html#clojure.spec.test/instrument
No, it s not a production usable thing. It ll trigger gen and be super slow/heavy. It doesnt just wrap args with simple validators
I wish we had another instrument for that personally, but now you have to roll your own basically
is anyone aware of some utility that does this ? basically all i want is to call s/explain whenever some pre or post condition is not matched