diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2009-05-14 00:43:54 +0000 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2009-05-14 00:43:54 +0000 |
commit | 05f97565d9d9b412754ef6295b95c1838ef20f68 (patch) | |
tree | 405004437943551189e6edae10b72df72b384f2b | |
parent | 8770e63cc1277d76204490a225e451a8de3b416b (diff) |
json/write.clj: doc strings
-rw-r--r-- | src/clojure/contrib/json/write.clj | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/clojure/contrib/json/write.clj b/src/clojure/contrib/json/write.clj index 0ec4fc98..d197f5cb 100644 --- a/src/clojure/contrib/json/write.clj +++ b/src/clojure/contrib/json/write.clj @@ -16,17 +16,25 @@ #^{:author "Stuart Sierra", :doc "JavaScript Object Notation (JSON) generator. -This is a low-level implementation of JSON. It supports basic types, -arrays, Collections, and Maps. You can extend it to handle new types -by adding methods to print-json. +This library will generate JSON from the following types: + * nil + * all primitives (Boolean, Byte, Short, Integer, Long, Float, Double) + * String (actually any CharSequence) + * java.util.Map (including Clojure maps) + * java.util.Collection (including Clojure vectors, lists, and sets) + * Java arrays + +You can extend this library to handle new types by adding methods to +print-json. This library does NOT attempt to preserve round-trip equality between -JSON and Clojure data types. That is, if you write a JSON string with +JSON and Clojure data types. That is, if you write a JSON string with this library, then read it back with clojure.contrib.json.read, you -won't necessarily get the exact same data structure. +won't necessarily get the exact same data structure. For example, +Clojure sets are written as JSON arrays, which will be read back as +Clojure vectors. -If you want round-trip equality and/or indented output, try Dan -Larkin's clojure-json library at +If you want indented output, try the clojure-json library at http://github.com/danlarkin/clojure-json This implementation attempts to follow the description of JSON at |