[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] json: Add support for encoding structs
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] json: Add support for encoding structs |
Date: |
Wed, 26 Apr 2017 08:13:10 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> Maybe one way is to distinguish '(:serialize-field nil) from '() by
> checking with memq for the key?
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).
> 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.
Stefan
- [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 <=
- Re: [PATCH] json: Add support for encoding structs, Vibhav Pant, 2017/04/27
- 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