[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new function proposal alist-to-hash
From: |
Stefan Monnier |
Subject: |
Re: new function proposal alist-to-hash |
Date: |
Sat, 05 Oct 2019 11:13:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> Sure, my example was just to point out easiness of use from a syntactic
> point of view. The good of having the list quoted by the user is that
> he can quasi-quote when needed what he needs.
But reading the rest of your response, it seems you're mostly interested
in the "literal" case (maybe using backquote+unquote to evaluate some
sub-elements).
> In python it would be simply something like this:
>
> nested_dict = { 'dictA': {'key_1': 'value_1'},
> 'dictB': {'key_2': 'value_2'}}
Python uses hash-tables to represent objects, whereas in Elisp this is
not the case: we use cl-defstruct, alist, or plists instead (hash-tables
are considered as relatively expensive, so if you know there will only
be a small number of entries, you're often better off with an alist).
Nested hash-tables are very rare in Elisp (so far).
Stefan
- new function proposal alist-to-hash, Andrea Corallo, 2019/10/03
- Re: new function proposal alist-to-hash, Andrea Corallo, 2019/10/04
- [PATCH] extend map-into (was: new function proposal alist-to-hash), Andrea Corallo, 2019/10/05
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/06
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/06
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/08
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/08
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/08
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/09
- Re: [PATCH] extend map-into, Stefan Monnier, 2019/10/09
- Re: [PATCH] extend map-into, Andrea Corallo, 2019/10/09