emacs-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]