Hello,
Consider the following valid JSON:
Clojure=> (def mq "{\"Question one\":\"test\"}")
#'user/mq
Clojure=> (read-json mq)
{:Question one "test"}
So the default behaviour fails to work correctly for a common case.
The Clojure failure is not exactly obvious either:
(read-string (str mq))
request failed java.lang.RuntimeException:
java.lang.ArrayIndexOutOfBoundsException: 19
at clojure.lang.RT.readString(RT.java:1220)
at clojure.core$read_string__4163.invoke(core.clj:2517)
I also tried with print-dup and it fails the same way:
=>(def ms (new StringWriter))
=>(print-dup mq ms)
=>(. ms toString)
"#=(clojure.lang.PersistentArrayMap/create {:Question one \"test\"})"
=>(read-string (. ms toString))
#<CompilerException java.lang.RuntimeException:
java.lang.ArrayIndexOutOfBoundsException: 3 (REPL:65)>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en