Created
September 11, 2014 17:13
-
-
Save rentalcustard/5a6181c4de9a49e3204b 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 new-if [pred then-clause else-clause] | |
`(cond ~pred ~then-clause | |
:else ~else-clause)) | |
"This works, in that if I call it like so: | |
" | |
(new-if (= 2 3) (while true (print "hi")) :bye) | |
"I don't get an infinite loop, but I don't understand how. I've unquoted everything in the macro body, so shouldn't the normal evaluation order apply? Why doesn't it evaluate then-clause when I do it this way? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment