Created
September 12, 2012 21:14
-
-
Save cark/3709981 to your computer and use it in GitHub Desktop.
one of two things
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
user> (defmacro as-doubled-pair [v] | |
`(let [v# (mapv (partial * 2) ~v)] | |
[v# v#])) | |
#'user/as-doubled-pair | |
user> (macroexpand (as-doubled-pair [1 2 3])) | |
[[2 4 6] [2 4 6]] | |
user> (defmacro as-doubled-pair2 [v] | |
(let [v (mapv (partial * 2) v)] | |
`(do [~v ~v]))) | |
#'user/as-doubled-pair2 | |
user> (macroexpand (as-doubled-pair2 [1 2 3])) | |
[[2 4 6] [2 4 6]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment