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 <[email protected]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.nl