Fork me on GitHub

I am trying to make the best case for clojure.spec I can, and apart from instrumentation and generators, I am trying to see if there is spec-powered tooling which is worth investigating thinking of something along these lines: in particular, any ways to integrate spec with cursive would be of great interest, as most folks on my job use it are there things you would suggest to check out?


I wanted to do data transformations from specs and down that path leads macro hell (see: with this helper I was told to just repeat the keys instead: After this interaction, I have found much delight in using malli. Being based on data it makes analysis and transformation fairly trivial; additionally it has clj-kondo support already built in: perhaps this clj-kondo transform and the graphviz one, plus the others built in would help make the case for adoption on your team.


@d.eltzner012 maybe my blog post from 2019 will help provide some useful insights for you?


Why the difference in spec forms of anon fns?

(s/form (s/nilable #(= 1 %)))
=> (clojure.spec.alpha/nilable
     (clojure.core/fn [%]
        (clojure.core/= 1 %)))

(s/form (s/or :maybe-one (s/nilable #(= 1 %))))
=> (clojure.spec.alpha/or
        (fn* [p1__11188#]
         (clojure.core/= 1 p1__11188#))))

Alex Miller (Clojure team)18:05:04

probably just not applying the right cleanup function on the latter