Created
June 29, 2012 22:06
-
-
Save zcaudate/3020937 to your computer and use it in GitHub Desktop.
do-until
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 do-until [& clauses] | |
(when clauses | |
(list | |
`when (first clauses) | |
(if (next clauses) | |
(second clauses) | |
(throw (IllegalArgumentException. | |
"do-until requires an even number of forms"))) | |
(cons 'do-until (nnext clauses))))) |
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
(do-until | |
true (println "Line 1") | |
nil (println "Line 2") | |
true (println "Line 3")) | |
; => "Line 1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment