[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: JSON->lisp Mapping: Hash vs AList
From: |
Eli Zaretskii |
Subject: |
Re: JSON->lisp Mapping: Hash vs AList |
Date: |
Thu, 14 Dec 2017 18:27:53 +0200 |
> From: Philipp Stephani <address@hidden>
> Date: Wed, 13 Dec 2017 22:37:46 +0000
> Cc: address@hidden
>
> Sounds reasonable, here is a patch.
Thanks.
> address@hidden json-parse-string string
> address@hidden json-parse-string string &key (object-type 'hash-table)
Hmm.. why is there an apostrophe before "hash-table"? What do you
want to get in the output there?
And btw, I don't see "&key" mentioned anywhere in the ELisp manual, so
I wonder whether the reader will understand what it means.
> + case json_object_alist:
> + {
> + result = Qnil;
> + const char *key_str;
> + json_t *value;
> + json_object_foreach (json, key_str, value)
> + {
> + Lisp_Object key = Fintern (json_build_string (key_str),
> Qnil);
> + result
> + = Fcons (Fcons (key, json_to_lisp (value, object_type)),
> + result);
> + }
> + result = Fnreverse (result);
Is there a reason for calling nreverse here?
> +The keyword argument OBJECT-TYPE specifies which Lisp type is used to
^^^^^^^^^^^
Shouldn't that be `:object-type' (including quotes)?
- JSON->lisp Mapping: Hash vs AList, raman, 2017/12/11
- Re: JSON->lisp Mapping: Hash vs AList, Nicolas Petton, 2017/12/12
- Re: JSON->lisp Mapping: Hash vs AList, Philipp Stephani, 2017/12/13
- Re: JSON->lisp Mapping: Hash vs AList, T.V Raman, 2017/12/13
- Re: JSON->lisp Mapping: Hash vs AList,
Eli Zaretskii <=
- Re: JSON->lisp Mapping: Hash vs AList, Philipp Stephani, 2017/12/16
- Re: JSON->lisp Mapping: Hash vs AList, Eli Zaretskii, 2017/12/17
- Re: JSON->lisp Mapping: Hash vs AList, Philipp Stephani, 2017/12/17
- Re: JSON->lisp Mapping: Hash vs AList, Eli Zaretskii, 2017/12/17
- Re: JSON->lisp Mapping: Hash vs AList, Philipp Stephani, 2017/12/18
- Re: JSON->lisp Mapping: Hash vs AList, Eli Zaretskii, 2017/12/18
- Re: JSON->lisp Mapping: Hash vs AList, Philipp Stephani, 2017/12/18
- Re: JSON->lisp Mapping: Hash vs AList, Vibhav Pant, 2017/12/18
- Re: JSON->lisp Mapping: Hash vs AList, Philipp Stephani, 2017/12/19
- Re: JSON->lisp Mapping: Hash vs AList, Eli Zaretskii, 2017/12/19