4 ms·
What do you mean by “inability to check macros”? You can s/fdef macros with spec and it checks the calls at compile time. In fact Clojure core uses spec to chec
by eduction 2y ago
What do you mean by “inability to check macros”? You can s/fdef macros with spec and it checks the calls at compile time. In fact Clojure core uses spec to check macro calls as you can see in the stack trace sometimes when you call one wrong. Do you mean something else?
- koito17 2y agoHere's what I mean by Malli's inability to check macros. https://github.com/clojure/clojure/blob/ad54fec/src/jvm/clojure/lang/Compiler.java#L7520 https://github.com/clojure/clojure/blob/ad54fec/src/jvm/cloj... The Clojure compiler directly calls into clojure.spec and does not expose any sort of hook for validating macros. No library can validate macros except clojure.spec. In this sense, Malli feels like a second-class citizen in Clojure compared to the built-in clojure.spec.
- eduction 2y agoAh thanks for explaining! I did not know they special cased spec. I hope that changes.