I tried to replicate the heuristics in json-encode, which converts the dotted pairs found in alists and the lists that it guesses are plists into reasonable JSON.
In addition, I added support for keywords and an error call when the parser encounters anything it doesn't know how to emit to make future debugging a bit easier.
Lastly, there's a line with a comment saying dotted pair to mark where one could add some sort of support for this as discussed in ticket #3. (N.B. that json-encode simply fails when fed a dotted pair that's not part of an alist.)
This patch allows JSON -> elisp -> EDN -> elisp -> JSON round tripping, in case that ever comes up. 😹
I tried to replicate the heuristics in
json-encode
, which converts the dotted pairs found inalist
s and the lists that it guesses areplist
s into reasonable JSON.In addition, I added support for
keyword
s and anerror
call when the parser encounters anything it doesn't know how to emit to make future debugging a bit easier.Lastly, there's a line with a comment saying
dotted pair
to mark where one could add some sort of support for this as discussed in ticket #3. (N.B. thatjson-encode
simply fails when fed a dotted pair that's not part of analist
.)This patch allows JSON -> elisp -> EDN -> elisp -> JSON round tripping, in case that ever comes up. 😹