This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-24
Channels
- # aleph (1)
- # beginners (43)
- # calva (22)
- # cider (51)
- # clerk (1)
- # clj-kondo (20)
- # clojure (29)
- # clojure-denmark (1)
- # clojure-europe (73)
- # clojure-finland (28)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (12)
- # data-science (2)
- # datomic (51)
- # events (1)
- # fulcro (20)
- # hyperfiddle (28)
- # integrant (6)
- # malli (20)
- # matrix (2)
- # music (1)
- # off-topic (66)
- # reitit (17)
- # releases (5)
- # ring (1)
- # shadow-cljs (31)
- # xtdb (6)
how is this possible? valid?
returns false, meaning v doesn't conform to spec, but explain
prints "Success!" as though it does
in general, cases of this are bugs
if you have one, please put it on https://ask.clojure.org
posted minimal example there https://ask.clojure.org/index.php/12957/inconsistent-results-from-valid-explain-when-trying-values
Can you add the spec? (preferably not tied to metosin stuff). Maybe you can (s/form ::sp)
to see it?
will this do?
case> (s/form (ds/spec ::sp cards))
(spec-tools.core/spec
{:spec (clojure.spec.alpha/keys :req-un [:case$sp/cards]),
:type :map,
:leaf? false,
:name :case/sp})
case> (s/form :case$sp/cards)
(spec-tools.core/spec
{:spec
(clojure.spec.alpha/coll-of
(spec-tools.core/spec
{:spec clojure.core/int?,
:type :long,
:leaf? true,
:name :case$sp/cards})
:into
[]),
:type :vector,
:leaf? false,
:spec-tools.core/synthetic? true})
I was told it might be issue of spec-tools itself, so I posted it on their github repo as well https://github.com/metosin/spec-tools/issues/275