[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help with guile-json inconsistencies
From: |
Aleix Conchillo Flaqué |
Subject: |
help with guile-json inconsistencies |
Date: |
Sun, 9 Dec 2018 02:56:18 -0800 |
Hi guilers,
a new guile-json issue came to me recently:
https://github.com/aconchillo/guile-json/issues/22
I don't really have a solution yet on how to solve this, so I would
love some advice. The issue is that one can do:
(scm->json '(1 2 3)) which returns [1,2,3]
however, if you do:
(scm->json '((1 2 3)) it returns {"1":[2,3]} but one would probably
expect [[1,2,3]]
(scm->json '((1 2 3) (4 5 6)) it returns {"1":[2,3], "4":[5,6]} but
one would probably expect [[1,2,3], [4,5,6]]
I guess the first question is, does everyone else feel the same way
about the return value?
The problem is that there's a function that checks if something is an
alist by basically checking if it's a pair? recursively and if so, it
builds a json object.
In the past, guile-json had a macro (json) which allowed you to do
(json (array (array...))) but I just realized it has exactly the same
problem. But may be there's some way to fix it.
Any help would be appreciated!
Best,
Aleix
- help with guile-json inconsistencies,
Aleix Conchillo Flaqué <=