Skip to content

Instantly share code, notes, and snippets.

@timsgardner
Created October 18, 2014 20:29
Show Gist options
  • Save timsgardner/d0174b57550274e3b72c to your computer and use it in GitHub Desktop.
Save timsgardner/d0174b57550274e3b72c to your computer and use it in GitHub Desktop.
defstg
(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#))))
@timsgardner
Copy link
Author

useful macro for evaluating forms while live coding in Unity. If the unity object defined already exists, wipes it from scene before redefing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment