aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/json
diff options
context:
space:
mode:
authorTom Faulhaber <git_net@infolace.com>2009-05-04 05:34:00 +0000
committerTom Faulhaber <git_net@infolace.com>2009-05-04 05:34:00 +0000
commit86e90011e274910c618a5592d21ba3ce290a6855 (patch)
treef5bedd2f64d52b0050662f637b2d084a3c05356a /src/clojure/contrib/json
parent870a47e859bdea719e253e8116f7da8b115594ce (diff)
Lots 'o doc strings
Diffstat (limited to 'src/clojure/contrib/json')
-rw-r--r--src/clojure/contrib/json/read.clj14
-rw-r--r--src/clojure/contrib/json/write.clj9
2 files changed, 20 insertions, 3 deletions
diff --git a/src/clojure/contrib/json/read.clj b/src/clojure/contrib/json/read.clj
index 7276e089..084f2a12 100644
--- a/src/clojure/contrib/json/read.clj
+++ b/src/clojure/contrib/json/read.clj
@@ -30,7 +30,19 @@
-(ns clojure.contrib.json.read
+(ns
+ #^{:author "Stuart Sierra",
+ :doc "JavaScript Object Notation (JSON) parser
+
+ For more information on JSON, see http://www.json.org/
+
+ This library parses data in JSON format. This is a fairly strict
+ implementation of JSON as described at json.org, not a full-fledged
+ JavaScript parser. JavaScript functions and object constructors
+ are not supported. Object field names must be quoted strings; they
+ may not be bare symbols.",
+ :see-also ["http://www.json.org", "JSON Home Page"]}
+ clojure.contrib.json.read
(:import (java.io PushbackReader StringReader EOFException))
(:use [clojure.contrib.test-is :only (deftest- is)]))
diff --git a/src/clojure/contrib/json/write.clj b/src/clojure/contrib/json/write.clj
index 6983ad78..2d149021 100644
--- a/src/clojure/contrib/json/write.clj
+++ b/src/clojure/contrib/json/write.clj
@@ -17,14 +17,19 @@
-(ns clojure.contrib.json.write
+(ns
+ #^{:author "Stuart Sierra",
+ :doc "JavaScript Object Notation (JSON) generator",
+ :see-also ["http://www.json.org", "JSON Home Page"]}
+ clojure.contrib.json.write
(:use [clojure.contrib.test-is :only (deftest- is)]))
(defmulti
#^{:doc "Prints Clojure data types as JSON. Nil becomes JSON null.
Keywords become strings, without the leading colon. Maps become
JSON objects, all other collection types become JSON arrays.
- Strings and numbers print as with pr."}
+ Strings and numbers print as with pr."
+ :arglists '([x])}
print-json (fn [x]
(cond (nil? x) nil
(map? x) :object