emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Implement fast verisons of json-parse functions


From: Mattias Engdegård
Subject: Re: [PATCH] Implement fast verisons of json-parse functions
Date: Sun, 31 Mar 2024 16:51:34 +0200

31 mars 2024 kl. 07.08 skrev Eli Zaretskii <eliz@gnu.org>:

> Well, it's "kind-of" wrong argument: a string with embedded null
> bytes.  But I'm also interested to hear from Mattias on this (and from
> anyone else who might have an opinion about the kind of error we
> should signal in this case).

I don't think users care much about the exact error we produce as long as it's 
reasonably descriptive. It's only when user might reasonably discriminate 
between different errors programmatically that it really matters. We certainly 
shouldn't have a special message for NULs.

I spent a slow morning speeding up the new JSON parser substantially by not 
doing stupid work, and all UTF-8 decoding errors will now be 
`json-utf8-decode-error` instead of `json-parse-error`. I think we can live 
with that.

The patch, which will be pushed shortly, also fixes a few long-standing bugs, 
such as

  (json-parse-string "{\"é\":1}" :object-type 'plist)

which resulted in a mangled symbol name.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]