Fork me on GitHub

speced.def provides defn, defprotocol, fn macros with identical syntax to that of clojure.core. The difference lies in that you can pass clojure.spec specs, expressed as metadata. That metadata compiles to :pre/`:post` conditions. The key benefits are: - 1:1 mapping to clojure.core's syntax, enabling concision/DRYness, a flat learning curve, and compatibility with every IDE - specs can be inferred out of type hints, and vice versa - you can pass metadata at arbitrary levels of destructuring, so you can spec more things - jvm and clojurescript compatibility - rich error reporting, even richer than that offered by stock Expound It's been battled-tested non-stop at Nedap since February, in an increasing number of projects. Hope you find it enjoyable!

👍 88
👏 16
aw_yeah 16
clj 12
Jivago Alves12:07:00

@U45T93RA6 Thanks for sharing. I was wondering what does it bring to the table when compared with the following libraries: - - - - Would you mind clarifying what's the intended purpose of this one please? 🙂


ty for the interest! I know those well and the difference is expressed in the key benefits summarized above. The alternatives lack at least one of: completeness (defprotocol?), reach (cljs?), efficiency (type inference?), among other stuff expressed in the readme.

Jivago Alves12:07:07

Got it. Thanks for clarifying!

✌️ 4

Have to say, Ghostwheel has some interesting ideas, but at the same time I feel it bloats defn with features that really don't belong there, and could as well be placed somewhere else and composed later. speced.def is simple: metadata in, a prepost map out.

👍 4

@U45T93RA6 that is a really elegant way to incorporate inline specs. Bravo! 👏

clj 28

clojure iapetos prometheus client. a project of clj-commons, merged on upstream doc of prometheus 🚀

clj 12
Alex Miller (Clojure team)22:07:49

InsideClojure Journal 2019.21 -, tools.deps

👍 56
clj 20
🚀 16
❤️ 8