This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-02
Channels
- # announcements (2)
- # beginners (32)
- # boot (10)
- # calva (81)
- # cider (39)
- # clojure (56)
- # clojure-europe (8)
- # clojure-italy (7)
- # clojure-new-zealand (1)
- # clojure-nl (8)
- # clojure-poland (1)
- # clojure-spec (12)
- # clojure-uk (38)
- # clojurescript (5)
- # community-development (1)
- # core-async (55)
- # cursive (3)
- # datomic (44)
- # dirac (15)
- # emacs (20)
- # events (1)
- # fulcro (57)
- # hyperfiddle (2)
- # jobs (9)
- # juxt (9)
- # kaocha (1)
- # lein-figwheel (1)
- # off-topic (93)
- # pathom (2)
- # pedestal (3)
- # planck (3)
- # reitit (15)
- # ring (10)
- # shadow-cljs (25)
- # spacemacs (7)
- # sql (19)
- # tools-deps (8)
Hi all, is there an predicate for whether something is a valid spec? Something like specize
(not public api), but returns true or false. I guess I could do:
(defn spec?
[spec]
(try
(do (s/conform spec nil) true)
(catch Exception e
false)))
But maybe I missed something easy?@mattmorten, thanks for the response. The issue with that is it returns false things that are valid specs, like functions and keywords that resolve to spec objects.
Ah, sorry, misunderstood. No I don't think I know of anything like you ask
Are there any suggestions for tracking down "Couldn't satisfy such-that predicate" errors? The exception it throws doesn't appear to give any clues as to which predicate is the problem. I'm wondering if there is a faster option that my current approach of narrowing down my recent changes
unfortunately, not really atm. I will tell you that most of the time it's from an s/and
where the initial gen is too wide for the subsequent filter(s)
yeah, I narrowed it down pretty quickly and it was indeed an and
. just one of those minor annoyances.
there is some new stuff in the latest test.check but we haven't yet looked at how to make it better to expose the info out through spec
certainly, it's annoying, and I have spent a lot of time doing the same