Skip to content

Instantly share code, notes, and snippets.

@code-shoily
Created May 11, 2015 18:01
Show Gist options
  • Save code-shoily/b2a57d1bd20802cb70be to your computer and use it in GitHub Desktop.
Save code-shoily/b2a57d1bd20802cb70be to your computer and use it in GitHub Desktop.
(defmacro cl-cond
[& others]
(if others
(let [more# (next others)
extra-clauses# (if more# `(cl-cond ~@more#))
clause# (first others)]
(if (= 2 (count clause#))
`(if ~(first clause#) ~(second clause#) ~extra-clauses#)
`(if ~(first clause#) ~(first clause#) ~extra-clauses#)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment