I use c.c.json heavily in my project and I kind of agree, it should be strings 
since in the json definition keys have to be strings, only problem is 
serialization as in how to serialize a keyword them? 


Regards,
Heinz
On Feb 28, 2010, at 15:36 , Stuart Sierra wrote:

> Mark,
> 
> Thank you!  I argued for this for months, but everyone kept insisting
> on keywords by default.  Now you just have to convince the other 2
> people who actually use clojure.contrib.json.
> 
> -SS
> 
> 
> On Feb 27, 3:55 pm, MarkSwanson <mark.swanson...@gmail.com> wrote:
>> 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 clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to