Skip to content

Instantly share code, notes, and snippets.

@tmountain
Created December 1, 2009 21:46
Show Gist options
  • Save tmountain/246687 to your computer and use it in GitHub Desktop.
Save tmountain/246687 to your computer and use it in GitHub Desktop.
(defmacro or
"Evaluates exprs one at a time, from left to right. If a form
returns a logical true value, or returns that value and doesn't
evaluate any of the other expressions, otherwise it returns the
value of the last expression. (or) returns nil."
([] nil)
([x] x)
([x & next]
`(let [or# ~x]
(if or# or# (or ~@next)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment