Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Compiler by
retagged ago by

clojure.spec.alpha currently holds a privileged position as a core library for Clojure core, being able to instrument macros as well as functions. Compiler.java relies on clojure.spec.alpha in this function, calling macroexpand-check specifically. This is a neat interaction and macroexpand-check is simple and obvious.

Other tools (such as Malli) can provide instrumentation for Clojure functions through alter-var-root (as seen in malli.instrument/-strument!), but they lack the ability to hook into macro-expansions.

It would be nice if Compiler.checkSpecs had some hook to allow for tools such as Malli to be used to instrument macros.

1 Answer

+1 vote
ago by