GNU bug report logs - #32793
27.0.50; json-parse-string doesn't have the equivalent of json.el's json-array-type

Previous Next

Package: emacs;

Reported by: Xu Chunyang <mail <at> xuchunyang.me>

Date: Fri, 21 Sep 2018 12:58:01 UTC

Severity: minor

Found in version 27.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mail <at> xuchunyang.me, 32793 <at> debbugs.gnu.org
Subject: bug#32793: 27.0.50; json-parse-string doesn't have the equivalent of json.el's json-array-type
Date: Fri, 12 Apr 2019 18:45:46 +0300
[Message part 1 (text/plain, inline)]
On 12.04.2019 18:26, Eli Zaretskii wrote:

> This argument is meaningless for serializing, I think.  But OK.

I wouldn't be so sure. For instance, one could attempt to resolve the 
alist-list conflict using a combination of :object-type and :array-type 
parameters. This isn't going to work, at least not yet. It's better to 
fail earlier.

> You just didn't try an array big enough for this to matter.

My array was big enough for the switch from json.el to json.c to make a 
real difference.

Anyway, it depends on how "big" the elements inside the array are as 
well. In my case they're fairly complex too.

> I don't mind, although in that case the loop just assigns value to a
> vector that was already consed.

It also calls

  json_to_lisp (json_array_get (json, i), conf)

in that loop.

>> json-parse-buffer and NEWS don't need updating, I think.
> 
> They don't?  Why not?

There was no json.c in Emacs 26. NEWS describes the changes from the 
previous release, and the current entry only lists the public functions.

json-parse-buffer doesn't enumerate the keyword arguments either.

>> +The keyword argument `:array-type' specifies which Lisp type is used
>> +to represent arrays; it can be `array' or `list'.
> 
> Please say here that 'array' is the default.

OK. I've had to update the preceding paragraph as well.

Good to install?
[json-array-type.diff (text/x-patch, attachment)]

This bug report was last modified 6 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.