From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#15097: 24.3.50; json.el can't encode lists of lists Date: Wed, 14 Aug 2013 21:55:50 -0400 Message-ID: References: <87pptf7uzv.fsf@sapo.pt> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1376531767 23220 80.91.229.3 (15 Aug 2013 01:56:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Aug 2013 01:56:07 +0000 (UTC) Cc: 15097@debbugs.gnu.org To: Rolando Pereira Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 15 03:56:08 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V9mnH-0006Jp-W8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2013 03:56:08 +0200 Original-Received: from localhost ([::1]:50881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9mnH-0003sF-Jg for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Aug 2013 21:56:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9mnE-0003s7-4M for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 21:56:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9mnC-0000Sd-Dz for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 21:56:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9mnC-0000SY-Ae for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 21:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V9mnB-0005fw-W2 for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2013 21:56:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87pptf7uzv.fsf@sapo.pt> Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2013 01:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15097 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15097-submit@debbugs.gnu.org id=B15097.137653175521800 (code B ref 15097); Thu, 15 Aug 2013 01:56:01 +0000 Original-Received: (at 15097) by debbugs.gnu.org; 15 Aug 2013 01:55:55 +0000 Original-Received: from localhost ([127.0.0.1]:59255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9mn4-0005fY-KZ for submit@debbugs.gnu.org; Wed, 14 Aug 2013 21:55:54 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:38867 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9mn2-0005fQ-Mp for 15097@debbugs.gnu.org; Wed, 14 Aug 2013 21:55:53 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1V9mn1-0001BV-2G; Wed, 14 Aug 2013 21:55:51 -0400 X-Spook: Dick Cheney Kh-11 doctrine offensive information warfare X-Ran: ]0rD:\G]daEkW;SaSEsU#dsi3.iX,$wpWq![[Nb)dM0oxzZ=$^X)Yco3"$fMgQ6U~=Nk|E X-Hue: cyan X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77364 Archived-At: Rolando Pereira wrote: > The function `json-encode' can't encode a list thats composed only of other > lists, i.e. the following doesn't work: > > (json-encode '((1 2 3))) => Error: (json-key-format 1) [...] > (ert-should (string= (json-encode '((1 2 3))) "[[1,2,3]]")) ; doesn't work I have no idea what this stuff is supposed to do, but by inspection it treats such arguments as alists and requires that the key be encodable as a string. Eg this works (json-encode '((a 2 3))) -> "{\"a\":[2, 3]}" Your example fails because 1 is encoded as 1, not "1". Should the answer be "{\"1\":[2, 3]} or "[[1,2,3]]"?