Skip to content

Instantly share code, notes, and snippets.

@emidln
Created January 23, 2014 23:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emidln/8589060 to your computer and use it in GitHub Desktop.
Save emidln/8589060 to your computer and use it in GitHub Desktop.
if-let (ala scheme or clojure) in Hy!
(defmacro/g! if-let [bindings then &rest else]
(let [[form (first bindings)]
[tst (second bindings)]]
`(let [[~g!temp ~tst]]
(if ~g!temp
(let [[~form ~g!temp]]
~then)
~@else))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment