From: Tino Calancha <tino.calancha@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Nicolas Petton <nicolas@petton.fr>,
Tino Calancha <tino.calancha@gmail.com>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: [ELPA] New package: hap.el
Date: Thu, 2 Mar 2017 15:02:32 +0900 (JST) [thread overview]
Message-ID: <alpine.DEB.2.20.1703021446430.22314@calancha-pc> (raw)
In-Reply-To: <jwvmvd5yv38.fsf-monnier+gmane.emacs.devel@gnu.org>
On Wed, 1 Mar 2017, Stefan Monnier wrote:
>> It might be convenient to group together under same file all these
>> related operations. Thus, I'd like to add this file to Elpa (or Emacs
>> core, whatever is appropiate), in case people think it's useful.
>
> Would it make sense to add this to map.el?
That is a good idea. Some part fit well.
> At least the conversion between alist and hash-tables is already in
> map.el under the name `map-into`.
In hap.el, optionally, you can convert from alist to hash table,
so that:
(let ((map '((1 . a) (1 . foo) (2 . b))))
(equal
(alist-get 1 map)
(gethash 1 (map-into map 'hash-table))))
=> t
Maybe map.el might offer same thing.
I think that is important.
One of the reasons to convert alist to hash table might be
that the size of the alist became large. Under such assumption,
you might want to use a hash table to do faster queries. In case
you have duplicated keys in the alist you'd get the wrong results.
We might add a new function `map-equal' that return true when
MAP1 and MAP2 have same type and data; for hash tables we might
compare the properties as well.
> map.el currently doesn't accommodate plists, but maybe that can be fixed
> (e.g. by checking (consp (car map)) and/or by adding a few
> functions specially designed for plists).
We might do plist-get setf-able as it was done for alist-get.
next prev parent reply other threads:[~2017-03-02 6:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-01 9:00 [ELPA] New package: hap.el Tino Calancha
2017-03-01 13:44 ` Mark Oteiza
2017-03-01 13:46 ` Stefan Monnier
2017-03-02 6:02 ` Tino Calancha [this message]
2017-03-02 6:43 ` Stefan Monnier
2017-03-02 6:52 ` Tino Calancha
2017-03-02 9:03 ` Nicolas Petton
2017-03-02 9:37 ` Tino Calancha
2017-03-02 10:29 ` Nicolas Petton
2017-03-02 12:38 ` Nicolas Petton
2017-03-02 13:07 ` Tino Calancha
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1703021446430.22314@calancha-pc \
--to=tino.calancha@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=nicolas@petton.fr \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.