-
-
Save bmabey/5493dccd66a0964d5509 to your computer and use it in GitHub Desktop.
I suck at macros
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 macro-test [name] | |
(let [fn-name (symbol (str "prefix-" name))] | |
(str fn-name))) | |
#'user/macro-test | |
user> (macro-test "foo") | |
"prefix-foo" | |
user> (let [my-name "foo"] (macro-test my-name)) | |
"prefix-my-name" # how can I get this to be "prefix-foo" ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment