[Top][All Lists]

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

Re: [PATCH] json: Add support for encoding structs

From: Vibhav Pant
Subject: Re: [PATCH] json: Add support for encoding structs
Date: Thu, 27 Apr 2017 12:20:35 +0530

On Wed, Apr 26, 2017 at 5:43 PM, Stefan Monnier
<address@hidden> wrote:
> FWIW, while you can make this work, I think it's a bad API: Elisp
> usually behaves like "an absent argument is equivalent to nil", and it's
> easier for the coder if we stick to this behavior (also, occasionally
> it's handy to be able to use ":key nil" in order not to pass :key).
Fair point, I was thinking that slot opts aren't exactly an API, so this
was an exception.

>> IIRC, the empty string is a valid JSON key (`JSON.parse(`{"":1}`)`
>> works in JS).  Symbols are also considered a valid type according to
>> `json-encode-key'.
> I don't see why that forces us to also accept symbols here.

Wouldn't it be consistent to allow symbols in both `json-encode' and

Vibhav Pant

reply via email to

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