This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-30
Channels
- # announcements (20)
- # asami (26)
- # babashka (10)
- # babashka-sci-dev (18)
- # beginners (81)
- # biff (6)
- # calva (6)
- # cider (1)
- # clerk (1)
- # clj-kondo (34)
- # clojure (50)
- # clojure-belgium (1)
- # clojure-berlin (6)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (22)
- # clojure-uk (2)
- # clojurescript (1)
- # clr (4)
- # community-development (3)
- # data-science (8)
- # datomic (3)
- # gratitude (1)
- # honeysql (6)
- # instaparse (2)
- # jobs (1)
- # jobs-discuss (13)
- # kaocha (7)
- # london-clojurians (1)
- # lsp (6)
- # malli (8)
- # matcher-combinators (9)
- # missionary (3)
- # nbb (8)
- # off-topic (20)
- # pathom (16)
- # polylith (2)
- # practicalli (3)
- # rdf (1)
- # re-frame (7)
- # reagent (3)
- # releases (2)
- # reveal (6)
- # rewrite-clj (22)
- # shadow-cljs (64)
- # tools-build (7)
- # xtdb (13)
has anyone written a generic malli schema to spec converter function i can steal? as i transition a code base over to malli, would be a helpful tool
☝️ 2
I remember this thread: https://clojurians.slack.com/archives/CLDK6MFMK/p1663090650431439 No idea if anything changed from that time.
Thanks 🙏 this looks interesting from the thread and exactly my use case https://github.com/Blasterai/malli-datomic
I’m trying to do generative testing on some functions created with mx/defn. Is there a good way to see how many things match a filter for mi/check
?
(mi/check {:filters [(mi/-filter-var #{#'my/wacky-fxn})]})
I’d like to double check that I actually got a var. Ideally check would return something like {my.ns/wacky-fxn :ok}
. Does this exist somewhere already?
It looks like -strument calls into :mode after the var lookup doesn’t happen. I can build a similar thing myself in that caseI ended up just passing the var into this
(defn- check-fn! [fn-var & [iterations]]
(let [iterations (or iterations 5000)]
(if-let [result ((mg/function-checker (:schema (meta fn-var)) {::mg/=>iterations iterations}) @fn-var)]
result
{:pass? true :iterations iterations})))
which will throw if the var isn’t resolvable