unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: new function proposal alist-to-hash
Date: Sat, 05 Oct 2019 15:45:45 +0000	[thread overview]
Message-ID: <xjf36g7urfa.fsf@sdf.org> (raw)
In-Reply-To: <jwva7aftelx.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 05 Oct 2019 11:13:31 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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).

Correct.

>> 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).

I guess one of the reasons is that as discussed depending on the case
expressing them in a literal form can be not so convenient.

>         Stefan
>

Bests
  Andrea

--
akrl@sdf.org



  reply	other threads:[~2019-10-05 15:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  9:58 new function proposal alist-to-hash Andrea Corallo
2019-10-04 19:16 ` Stefan Monnier
2019-10-05  8:18   ` Andrea Corallo
2019-10-05 15:13     ` Stefan Monnier
2019-10-05 15:45       ` Andrea Corallo [this message]
2019-10-05  8:28   ` [PATCH] extend map-into (was: new function proposal alist-to-hash) Andrea Corallo
2019-10-06 14:02     ` [PATCH] extend map-into Stefan Monnier
2019-10-06 20:59       ` Andrea Corallo
2019-10-08 17:29         ` Stefan Monnier
2019-10-08 18:46           ` Andrea Corallo
2019-10-08 20:23             ` Stefan Monnier
2019-10-09 15:35               ` Andrea Corallo
2019-10-09 19:41                 ` Stefan Monnier
2019-10-09 20:02                   ` Andrea Corallo
2019-10-10  8:27                     ` Nicolas Petton
2019-10-10  8:28                     ` Nicolas Petton
2019-10-10 10:06                       ` Andrea Corallo
2019-10-10 11:47                         ` Nicolas Petton
2019-10-11 16:19                         ` Stefan Monnier
2019-10-11 16:29                           ` Andrea Corallo
  -- strict thread matches above, loose matches on Subject: below --
2019-10-03 21:25 new function proposal alist-to-hash Andrea Corallo
2019-10-03 21:40 ` Drew Adams
2019-10-03 21:56 ` Stefan Monnier
2019-10-03 22:07   ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjf36g7urfa.fsf@sdf.org \
    --to=akrl@sdf.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).