unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Christopher Allan Webber <cwebber@dustycloud.org>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: guile-json 0.5.0 released
Date: Wed, 24 Feb 2016 20:09:17 +0100	[thread overview]
Message-ID: <87bn76lyci.fsf@drakenvlieg.flower> (raw)
In-Reply-To: <877fhukpfi.fsf@dustycloud.org> (Christopher Allan Webber's message of "Wed, 24 Feb 2016 09:07:13 -0800")

Christopher Allan Webber writes:

> Aleix Conchillo Flaqué 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 = "{\"a\" : [\"b\", \"c\", \"d\"]}"

>   ["a", "b", "c", "d"]

    scheme@(json)> (scm->json-string '(a . (b c d)))
    $3 = "[\"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

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



      reply	other threads:[~2016-02-24 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24  6:23 guile-json 0.5.0 released Aleix Conchillo Flaqué
2016-02-24 17:07 ` Christopher Allan Webber
2016-02-24 19:09   ` Jan Nieuwenhuizen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bn76lyci.fsf@drakenvlieg.flower \
    --to=janneke@gnu.org \
    --cc=cwebber@dustycloud.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).