Skip to content

Instantly share code, notes, and snippets.

@ertugrulcetin
Last active July 26, 2016 23:13
Show Gist options
  • Save ertugrulcetin/ef439c50770918abf58e to your computer and use it in GitHub Desktop.
Save ertugrulcetin/ef439c50770918abf58e to your computer and use it in GitHub Desktop.
(defmacro if-let*
([bindings then]
`(if-let* ~bindings ~then nil))
([bindings then else]
(if (seq bindings)
`(if-let [~(first bindings) ~(second bindings)]
(if-let* ~(drop 2 bindings) ~then ~else)
~(if-not (second bindings) else))
then)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment