clojure-australia

Hugh Powell 2021-05-03T00:18:01.044200Z

Morning folks πŸ‘‹

Oliver George 2021-05-03T01:29:48.044900Z

G'day

lsenjov 2021-05-03T22:43:55.045700Z

Morning all πŸ‘‹ Spent a couple hours yesterday retrofitting schema’s defn macro to work with malli instead

πŸ‘‹ 1
anonimitoraf 2021-05-05T08:03:30.049500Z

Mind sharing how? Im curious because Im starting to play around with malli myself. Also, what are your thoughts on spec 2?

lsenjov 2021-05-05T23:25:20.052600Z

Grabbed the schema macros and modified them to use malli instead

lsenjov 2021-05-05T23:25:24.052800Z

That's honestly it πŸ˜‚

lsenjov 2021-05-05T23:25:58.053Z

Was actually fairly painless, just a bit of thinking

lsenjov 2021-05-05T23:26:09.053200Z

As for spec2, I've only glanced at it but I'm still not sold

lsenjov 2021-05-05T23:26:49.053400Z

Putting things in a registry and needing a separate fdef, both make it harder to read things

anonimitoraf 2021-05-06T09:16:22.054200Z

Oh right. How did you go about instrumenting with malli? (Assuming you do)

lsenjov 2021-05-06T21:59:03.054700Z

Not specifically instrumenting. So spec has its instrument for replacing a function with a version with the fdef applied. Schema's version is to declare it on the defn itself with some optional symbol :- type syntax, then switch it on with a global var

lsenjov 2021-05-06T22:00:04.054900Z

There's also a switch for not allowing compilation at all, so it just adds the raw defn without any checking (basically elide asserts)

lsenjov 2021-05-06T22:00:28.055100Z

Plus it constructs the equivalent of fdef while you're at it

anonimitoraf 2021-05-08T00:51:09.056200Z

Reading schema's docs (Ive not used it before) :- seems to be just for type hints, is that right?

lsenjov 2021-05-08T23:24:23.056400Z

Basically yeah. Although it also attaches pre/post maps validating those types when checking is on