Skip to content

Instantly share code, notes, and snippets.

@bmabey

bmabey/why.clj Secret

Created March 13, 2012 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmabey/5493dccd66a0964d5509 to your computer and use it in GitHub Desktop.
Save bmabey/5493dccd66a0964d5509 to your computer and use it in GitHub Desktop.
I suck at macros
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