Created
December 1, 2009 21:46
-
-
Save tmountain/246687 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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