Created
November 7, 2017 23:14
-
-
Save sundarj/f2083c102d09e01f9323ce16431eabb6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defn render-pattern [pattern replacements-map] | |
(for [item pattern] (if (symbol? item) (get replacements-map item) item))) | |
#'boot.user/render-pattern | |
(render-pattern | |
`["my apple is named " ?apple-name " and i hate " ?hated-thing] | |
`{?apple-name "peter", ?hated-thing "imperative programming"}) | |
("my apple is named " "peter" " and i hate " "imperative programming") | |
(apply str *1) | |
"my apple is named peter and i hate imperative programming" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.