Skip to content

Instantly share code, notes, and snippets.

@lynxluna
Last active August 29, 2015 14:05
Show Gist options
  • Save lynxluna/fea48dba6a7a58a916ca to your computer and use it in GitHub Desktop.
Save lynxluna/fea48dba6a7a58a916ca to your computer and use it in GitHub Desktop.
(defmacro def-if
"Define a symbol when one condition is met"
([condition sym true-expr]
(if condition `(def sym ~true-expr)))
([condition sym true-expr false-expr]
(if condition `(def sym ~true-expr) `(def sym ~false-expr))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment