Created
October 18, 2014 20:29
-
-
Save timsgardner/d0174b57550274e3b72c to your computer and use it in GitHub Desktop.
defstg
This file contains hidden or 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 defstg [name & body] | |
`(do (declare ~name) | |
(let [bldg# (do ~@body)] | |
(when-not | |
(instance? clojure.lang.Var+Unbound | |
(var-get (resolve (quote ~name)))) | |
(destroy ~name)) | |
(def ~name bldg#)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
useful macro for evaluating forms while live coding in Unity. If the unity object defined already exists, wipes it from scene before redefing.