diff options
author | Ben Smith-Mannschott <bsmith.occs@gmail.com> | 2010-08-28 11:22:22 +0200 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2010-09-03 12:23:37 -0400 |
commit | fe4ed311166677cd571d23774171af1d830f7fc5 (patch) | |
tree | 70d6c519b8afa7bbee51bb8c3e243d4f3903b2e2 /modules/json/src | |
parent | 034d3d1703d139117b38fe6a10f552e23aa48b5c (diff) |
remove deprecated clojure.contrib.string
Since clojure.contrib.string is used by other submodules, some changes
were required:
- gen-html-docs and prxml needed changes because of functions were
renamed or arguments reordered when promoted to clojure.string.
- jmx, json, miglayout, prxml and sql gained a private one-argument
implementation of as-str.
- repl-utils gained a private copy of c.c.string/partition, named
spartition.
- repl-utils replaced a call to c.c.string/substring? with a call to
the java String method '.contains' (with swapped argument order).
Signed-off-by: Stuart Sierra <mail@stuartsierra.com>
Diffstat (limited to 'modules/json/src')
-rw-r--r-- | modules/json/src/main/clojure/clojure/contrib/json.clj | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/json/src/main/clojure/clojure/contrib/json.clj b/modules/json/src/main/clojure/clojure/contrib/json.clj index 69f6cc9d..457f33c9 100644 --- a/modules/json/src/main/clojure/clojure/contrib/json.clj +++ b/modules/json/src/main/clojure/clojure/contrib/json.clj @@ -17,8 +17,7 @@ To write JSON, use json-str, write-json, or write-json. To read JSON, use read-json."} clojure.contrib.json - (:use [clojure.contrib.pprint :only (write formatter-out)] - [clojure.contrib.string :only (as-str)]) + (:use [clojure.contrib.pprint :only (write formatter-out)]) (:import (java.io PrintWriter PushbackReader StringWriter StringReader Reader EOFException))) @@ -228,6 +227,12 @@ (.append sb \") (.print out (str sb)))) +(defn- as-str + [x] + (if (instance? clojure.lang.Named x) + (name x) + (str x))) + (defn- write-json-object [m ^PrintWriter out] (.print out \{) (loop [x m] |