[cl-json-devel] Escaping of symbols in hash tables
Richard Newman
rnewman at tellme.com
Wed Feb 22 19:53:15 UTC 2006
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?
-R
More information about the cl-json-devel
mailing list