From rnewman at tellme.com Wed Feb 22 19:53:15 2006 From: rnewman at tellme.com (Richard Newman) Date: Wed, 22 Feb 2006 11:53:15 -0800 Subject: [cl-json-devel] Escaping of symbols in hash tables Message-ID: Hi, Is this intentional? (This tested against a brand-new checkout from the darcs repo.) ---- * (in-package :json) # * (encode-json-to-string 'x) "\"X\"" * (make-hash-table) # * (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 From henrik at evahjelte.com Wed Feb 22 22:01:12 2006 From: henrik at evahjelte.com (henrik hjelte) Date: Wed, 22 Feb 2006 23:01:12 +0100 Subject: [cl-json-devel] Escaping of symbols in hash tables In-Reply-To: References: Message-ID: <1140645673.9140.38.camel@localhost.localdomain> 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) > > # > * (encode-json-to-string 'x) > > "\"X\"" > * (make-hash-table) > > # > * (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 > > From henrik at evahjelte.com Wed Feb 22 22:32:54 2006 From: henrik at evahjelte.com (Henrik Hjelte) Date: Wed, 22 Feb 2006 23:32:54 +0100 Subject: [cl-json-devel] ANN: cl-json 0.1.3 Message-ID: <1140647575.9140.51.camel@localhost.localdomain> is available by asdf-install. Contains a bugfix when encoding hash-tables. /Henrik Hjelte