Created
November 21, 2020 21:04
-
-
Save ertugrulcetin/fa34f464595d1b313705289521814f9c to your computer and use it in GitHub Desktop.
Clojure nested macro sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro component | |
([name tag] | |
`(component ~name ~tag nil)) | |
([name tag docs] | |
(if docs | |
`(defmacro ~(with-meta name {:tag tag}) ~docs | |
[object# k# & options#] | |
`(u/call! ~object# ~k# ~@options#)) | |
`(defmacro ~(with-meta name {:tag tag}) | |
[object# k# & options#] | |
`(u/call! ~object# ~k# ~@options#))))) | |
(component sphere | |
com.badlogic.gdx.math.collision.Sphere | |
"Calls a single method on a `sphere`.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment