[Top][All Lists]

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

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

From: Ted Zlatanov
Subject: Re: [PATCH] json: Add support for encoding structs
Date: Tue, 25 Apr 2017 10:26:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Tue, 25 Apr 2017 18:10:59 +0530 Vibhav Pant <address@hidden> wrote: 

VP> On Tue, Apr 25, 2017 at 4:22 AM, Davis Herring <address@hidden> wrote:
>> You could use :json "" or :json 'ignore as the special value.

VP> IIRC, the empty string is a valid JSON key (`JSON.parse(`{"":1}`)`
VP> works in JS).
VP> Symbols are also considered a valid type according to
VP> `json-encode-key'.

Maybe one way is to distinguish '(:serialize-field nil) from '() by
checking with memq for the key?

On Tue, 25 Apr 2017 17:57:22 +0530 Vibhav Pant <address@hidden> wrote: 

>> Finally, maybe we could also consider using the existing facility
>> :print-function (the manual says that's currently unused). But I don't
>> know the full implications of that, so maybe it's a bad suggestion.

VP> Wouldn't that restrict encoding only to JSON?, I think passing all
VP> (json) encoding through json.el would be a better design.

Yeah, it's not a great suggestion :)

Thanks for all the work.


reply via email to

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