Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compile time bindings
(use 'clojure.walk)
(def ^:dynamic clazz)
(defmacro defout [& other]
(binding [clazz (first other)]
(let [other (mapv macroexpand-all other)]
`(~@other))))
(defmacro defin [& other]
`(~@other ~clazz))
(macroexpand-all
'(defout A
(defin :a)))
; => (A (:a A))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.