Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert a list of lists to json #3

Open
hinkelman opened this issue Oct 26, 2019 · 1 comment
Open

convert a list of lists to json #3

hinkelman opened this issue Oct 26, 2019 · 1 comment

Comments

@hinkelman
Copy link

hinkelman commented Oct 26, 2019

With a simple list, scm->json produces the following result.

> (define a '(1 2 3))
> (scm->json a)
[1, 2, 3]

However, a list of lists produces the following result.

> (define b '('(1 2 3) '(4 5 6)))
> (scm->json b)
{"quote" : {"1" : [2, 3]},"quote" : {"4" : [5, 6]}}

Is that the expected behavior? Because I was expecting this.

[[1, 2, 3], [4, 5, 6]]

Thanks!

@hinkelman
Copy link
Author

I realized that I was incorrectly creating a list of lists, but the general problem still remains.

> (define b '((1 2 3) (4 5 6)))
> (scm->json b)
{"1" : [2, 3],"4" : [5, 6]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant