Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Last active September 29, 2015 19:57
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 mwmitchell/1657499 to your computer and use it in GitHub Desktop.
Save mwmitchell/1657499 to your computer and use it in GitHub Desktop.
interpolate-with-map
(require '[clojure.contrib.strint :as strint])
(defmacro interpolate-with-map [s & {:as lettings}]
`(do
(let [{:keys [~@(map (comp symbol name) (keys lettings))]} ~lettings]
(strint/<< ~s))))
(interpolate-with-map "test this ~{n}" :n 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment