Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created July 19, 2011 05:31
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/1091384 to your computer and use it in GitHub Desktop.
Save amalloy/1091384 to your computer and use it in GitHub Desktop.
(let [html-wrapper (fn [tagname]
(fn [body]
(str "<" tagname ">" body "</" tagname ">")))
body-wrapper (html-wrapper "body")]
(body-wrapper "data"))
;=> "<body>data</body>"
;; or with defs
(defn html-wrapper [tagname]
(fn [body]
(str "<" tagname ">" body "</" tagname ">")))
(def body (html-wrapper "body"))
(body "data")
;=> "<body>data</body>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment