Skip to content

Instantly share code, notes, and snippets.

@masaedw
Created April 17, 2011 15:28
Show Gist options
  • Select an option

  • Save masaedw/924127 to your computer and use it in GitHub Desktop.

Select an option

Save masaedw/924127 to your computer and use it in GitHub Desktop.
(require '[clojure.contrib.io :as io])
(defmacro with-out-string
[& body]
`(let [writer# (java.io.StringWriter.)]
(io/with-out-writer writer#
~@body)
(-> writer# .toString)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment