[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-json 0.5.0 released

From: Jan Nieuwenhuizen
Subject: Re: guile-json 0.5.0 released
Date: Wed, 24 Feb 2016 20:09:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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!


> 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.


Jan Nieuwenhuizen <address@hidden> | GNU LilyPond
Freelance IT | Avatar®  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]