Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created June 30, 2011 18:53
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 amalloy/1056906 to your computer and use it in GitHub Desktop.
Save amalloy/1056906 to your computer and use it in GitHub Desktop.
(defmacro selfp [x]
`(= ~x '~x))
(defmacro maybe-quote [& body]
(cons `do (for [item body]
(if (selfp item)
item
`'~item))))
(macroexpand '(maybe-quote stuff :test item))
;; (do (quote stuff) (quote :test) item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment