From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.user Subject: Re: guile-json 0.5.0 released Date: Wed, 24 Feb 2016 20:09:17 +0100 Organization: AvatarAcademy.nl Message-ID: <87bn76lyci.fsf@drakenvlieg.flower> References: <877fhukpfi.fsf@dustycloud.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1456341004 13192 80.91.229.3 (24 Feb 2016 19:10:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Feb 2016 19:10:04 +0000 (UTC) Cc: guile-user To: Christopher Allan Webber Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Feb 24 20:09:50 2016 Return-path: Envelope-to: guile-user@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 1aYeom-0001Eu-6T for guile-user@m.gmane.org; Wed, 24 Feb 2016 20:09:48 +0100 Original-Received: from localhost ([::1]:37817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYeol-0007HJ-BP for guile-user@m.gmane.org; Wed, 24 Feb 2016 14:09:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYeoV-0007Fv-FW for guile-user@gnu.org; Wed, 24 Feb 2016 14:09:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYeoU-0004w1-Cz for guile-user@gnu.org; Wed, 24 Feb 2016 14:09:31 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYeoK-0004v7-46; Wed, 24 Feb 2016 14:09:20 -0500 Original-Received: from peder.onsbrabantnet.nl ([88.159.206.46]:50308 helo=drakenvlieg.flower.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aYeoJ-0006xQ-Fi; Wed, 24 Feb 2016 14:09:19 -0500 X-Url: http://AvatarAcademy.nl In-Reply-To: <877fhukpfi.fsf@dustycloud.org> (Christopher Allan Webber's message of "Wed, 24 Feb 2016 09:07:13 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12440 Archived-At: Christopher Allan Webber writes: > Aleix Conchillo Flaqu=C3=A9 writes: > >> I am happy to announce a new minor guile-json release 0.5.0. This >> release allows converting simple alists to json. Thanks to Jan >> Nieuwenhuizen! Yay! > BTW, how do you differentiate between these two cases? > > {"a": ["b", "c", "d"]} scheme@(json)> (scm->json-string '((a . (b c d)))) $2 =3D "{\"a\" : [\"b\", \"c\", \"d\"]}" > ["a", "b", "c", "d"] scheme@(json)> (scm->json-string '(a . (b c d))) $3 =3D "[\"a\", \"b\", \"c\", \"d\"]" > AFAICT both in scheme would be represented as: > > '("a" . ("b" "c" "d")) > > ... or can only symbols be keys? Alists (json-alist?) are converted to objects, other lists to arrays. A "json-alist" has key-value pairs and uses atoms as key. Greetings, Jan --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20