Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

expose backing fn for `code` macro

  • Loading branch information...
commit a22aaeec88ed560a728eb7126650a59fcabf8265 1 parent e8282c7
@cemerick cemerick authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main/clojure/clojure/tools/nrepl.clj
8 src/main/clojure/clojure/tools/nrepl.clj
@@ -134,6 +134,12 @@
(assoc m k v))))
{} (apply concat responses)))
+(defn code*
+ "Returns a single string containing the pr-str'd representations
+ of the given expressions."
+ [& expressions]
+ (apply str (map pr-str expressions)))
(defmacro code
"Expands into a string consisting of the macro's body's forms
(literally, no interpolation/quasiquoting of locals or other
@@ -141,7 +147,7 @@
{:op :eval, :code (code (+ 1 1) (slurp \"foo.txt\"))}"
[& body]
- (apply str (map pr-str body)))
+ (apply code* body))
(defn read-response-value
"Returns the provided response message, replacing its :value string with

0 comments on commit a22aaee

Please sign in to comment.
Something went wrong with that request. Please try again.