[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: JSON->lisp Mapping: Hash vs AList
From: |
Nicolas Petton |
Subject: |
Re: JSON->lisp Mapping: Hash vs AList |
Date: |
Tue, 12 Dec 2017 14:08:16 +0100 |
raman <address@hidden> writes:
> 2. The deeply nested nature of JSON dicts makes accessing things at
> deeper levels require nested calls to gethash -- leads to code that
> is opaque.
I agree that an option for alists would be nice.
However, you could use `map-nested-elt' to traverse any map (hash-table
or alist):
(map-nested-elt my-table '(key1 key2 key3))
map.el also provides `map-let' and a "map" `pcase' pattern, which can be
used to traverse nested hash-tables (and also works on alists, or a mix):
(pcase-let (((map ('key1 (map ('key2 (map key3))))) my-table))
...)
Cheers,
Nico
signature.asc
Description: PGP signature
- JSON->lisp Mapping: Hash vs AList, raman, 2017/12/11
- Re: JSON->lisp Mapping: Hash vs AList,
Nicolas Petton <=
- 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, 2017/12/14
- 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