[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
`json-encode-key`?
--
Vibhav Pant
address@hidden
- [PATCH] json: Add support for encoding structs, Vibhav Pant, 2017/04/23
- Re: [PATCH] json: Add support for encoding structs, Ted Zlatanov, 2017/04/24
- Re: [PATCH] json: Add support for encoding structs, Vibhav Pant, 2017/04/24
- Re: [PATCH] json: Add support for encoding structs, Ted Zlatanov, 2017/04/24
- Re: [PATCH] json: Add support for encoding structs, Ted Zlatanov, 2017/04/24
- Re: [PATCH] json: Add support for encoding structs, Stefan Monnier, 2017/04/24
- Re: [PATCH] json: Add support for encoding structs, Ted Zlatanov, 2017/04/25
- Re: [PATCH] json: Add support for encoding structs, Vibhav Pant, 2017/04/25
- Re: [PATCH] json: Add support for encoding structs, Ted Zlatanov, 2017/04/25
- Re: [PATCH] json: Add support for encoding structs, Stefan Monnier, 2017/04/26
- Re: [PATCH] json: Add support for encoding structs,
Vibhav Pant <=
- Re: [PATCH] json: Add support for encoding structs, Stefan Monnier, 2017/04/27
- Re: [PATCH] json: Add support for encoding structs, Vibhav Pant, 2017/04/25
- Re: [PATCH] json: Add support for encoding structs, Davis Herring, 2017/04/24
- Re: [PATCH] json: Add support for encoding structs, Vibhav Pant, 2017/04/25
Re: [PATCH] json: Add support for encoding structs, Clément Pit-Claudel, 2017/04/24