jonathan icon indicating copy to clipboard operation
jonathan copied to clipboard

Encoding a list of lists

Open shelvick opened this issue 4 years ago • 0 comments

I'm attempting to encode an alist value, which is a nested list, as a nested array. cl-json does what I'm looking for:

> (json:encode-json-to-string '((foo . bar) (baz . ((1 2 3) (4 5 6)))))
"{\"foo\":\"bar\",\"baz\":[[1,2,3],[4,5,6]]}"

However, Jonathan does something different, and I can't figure out how to get the nested lists right:

> (jonathan:to-json '((foo . bar) (baz . ((1 2 3) (4 5 6)))) :from :alist)
"{\"FOO\":\"BAR\",\"BAZ\":{\"1\":[2,3],\"4\":[5,6]}}"

Is this expected?

shelvick avatar Aug 13 '21 06:08 shelvick