This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-16
Channels
- # bangalore-clj (8)
- # beginners (78)
- # boot (68)
- # cljs-dev (32)
- # cljsrn (43)
- # clojars (2)
- # clojure (147)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-quebec (1)
- # clojure-russia (19)
- # clojure-spec (17)
- # clojure-uk (25)
- # clojurescript (98)
- # clr (2)
- # core-async (14)
- # cursive (5)
- # datascript (1)
- # datomic (23)
- # emacs (4)
- # hoplon (8)
- # jobs (4)
- # kekkonen (1)
- # lein-figwheel (9)
- # off-topic (2)
- # om (2)
- # om-next (9)
- # onyx (4)
- # planck (2)
- # re-frame (14)
- # ring-swagger (3)
- # untangled (18)
i think there’s a bug with :clojure.core.specs/binding-form
. it’s defined as
(spec/or :sym :clojure.core.specs/local-name
:seq :clojure.core.specs/seq-binding-form
:map :clojure.core.specs/map-binding-form)
but this is a problem if you actually want to use the data from conform
ing against it because
(spec/conform
:clojure.core.specs/binding-form
'{})
;; => [:seq {}]
which is the smallest example that demonstrates the problem (`{:as m}` conforms to a [:seq ,,,]
value). in order to fix this problem the spec needs to be reorganized to place :map
spec above the :seq
spec.
(spec/or :sym :clojure.core.specs/local-name
:map :clojure.core.specs/map-binding-form
:seq :clojure.core.specs/seq-binding-form)
here’s an example of the updated behavior
(spec/conform
(spec/or :sym :clojure.core.specs/local-name
:map :clojure.core.specs/map-binding-form
:seq :clojure.core.specs/seq-binding-form)
'{})
;; => [:map {}]
(spec/conform
(spec/or :sym :clojure.core.specs/local-name
:map :clojure.core.specs/map-binding-form
:seq :clojure.core.specs/seq-binding-form)
'[])
;; => [:seq {}]
There's already a ticket and a patch for this I think
Same thing I think?
We really need a vcat which would be better than either
In particular to c
Conform to a vector
you might also find stest/instrumentable-syms
or stest/checkable-syms
of interest re functions