Zulu-Inuoe/jzon

cannot encode a dotted pair

Opened this issue · 5 comments

Surprisingly JZON fails to encode a dotted pair, as it assumes it will be able to call length on the cdr

(jzon:stringify '(1 . 2))

as a side note, this issue (together with this one) was uncovered while testing cl-transit, which uses jzon for the JSON part.

Hi - Yes, jzon used to be clever about things like dotted pairs but it was scaled back. Instead it only encodes proper lists.

But I am a fan of "it just works". What do you believe a dotted pair should stringify to?

IMO a dotted pair ought to be encoded as is a list with 2 elements in it, and produce a JSON array of 2 elements

Alright. I appreciate it. I'll look through my notes later to see what past me had to say about this and get back to you.
I don't see the harm now that we don't do fancy alist/plist heuristic detection.

Thanks. And thanks again for the float report - I can't believe I forgot to test the trivial case on that one. Embarrassing.

Alright. I appreciate it. I'll look through my notes later to see what past me had to say about this and get back to you. I don't see the harm now that we don't do fancy alist/plist heuristic detection.

Thanks. And thanks again for the float report - I can't believe I forgot to test the trivial case on that one. Embarrassing.

haha no worries -- these things happen! thank you for contributing JZON