[cl-json-devel] Escaping of symbols in hash tables

henrik hjelte henrik at evahjelte.com
Wed Feb 22 22:01:12 UTC 2006


On ons, 2006-02-22 at 11:53 -0800, Richard Newman wrote:
> Hi,
>    Is this intentional? (This tested against a brand-new checkout  
> from the darcs repo.)
> 
> ----
> * (in-package :json)
> 
> #<PACKAGE "JSON">
> * (encode-json-to-string 'x)
> 
> "\"X\""
> * (make-hash-table)
> 
> #<HASH-TABLE :TEST EQL :COUNT 0 {40148169}>
> * (setf (gethash 'x *) 5)
> 
> 5
> * (encode-json-to-string **)
> 
> "{\"\"X\"\":5}"
> ----
> 
>    Dump this out to a stream, and you get
> 
> {""X"":5}
> 
>    which isn't so useful.
> 
>    I suspect it's because the symbol is encoded to "X", and then  
> wrapped in quotes anyway.
> 
>    I thought I'd mail the list before attempting to fix and submit a  
> patch.
> 
>    Opinions?

Yeah it is a bug. Or rather was, I just updated the darcs repository.

Thanks!

/Henrik

> 
> -R
> _______________________________________________
> cl-json-devel mailing list
> cl-json-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-json-devel
> 
> 




More information about the cl-json-devel mailing list