[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Accept plists when serializing and parsing JSON
From: |
João Távora |
Subject: |
Re: [PATCH] Accept plists when serializing and parsing JSON |
Date: |
Wed, 30 May 2018 09:58:05 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Yuri Khan <address@hidden> writes:
> On Wed, May 30, 2018 at 5:31 AM João Távora <address@hidden> wrote:
>
>> Well, it's not really "global state" in the sense I believe you're
>> talking about, because no part of the library is maintaining any state in
>> global variables -- it's read-only from json.c.
> after ironing out all [the other?] bugs related to shared state
Which ones? Those seem to be precisely the ones I meant to say are
excluded because the var is read-only.
> * ‘foo’ wants plists while ‘bar’ wants alists.
If "want" is the same thing as "must have", then bar should be setting
the var from the beginning, end of story. It should only not set the var
if it doesn't care.
There are many variables like this in emacs. Eli recently reminded me in
a closely related thread I have to bind coding-system-for-write around
process-send-string, for example.
Obviously, the pitfall is overlooking to bind them when you have
to. Presumably this is outweighed by the convenience of not passing a
trillion args to a function call and, more importantly, to every caller
of a function, like in the commit that removes the var, which is quite a
bit more complex (which is why I started with the other alternative).
Anyway, this point could be irrelevant if we remove the variable and
argument completely, auto-detecting plists. Can't decide if that could
be a worse idea, though.
João