unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	Nicolas Petton <nicolas@petton.fr>,
	28753@debbugs.gnu.org,
	Noam Postavsky <npostavs@users.sourceforge.net>
Subject: bug#28753: 25.3; Functions to get alist from hash table and vice versa
Date: Sat, 30 Dec 2017 21:15:34 +0000	[thread overview]
Message-ID: <CAArVCkSGV19P9tu2eamHrjaFN3ve0XUHrvTFMdUhNYoObiXKrw@mail.gmail.com> (raw)
In-Reply-To: <a3bfa53f-9572-47af-88af-c49240e34e6b@default>

[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]

Drew Adams <drew.adams@oracle.com> schrieb am Sa., 30. Dez. 2017 um
22:08 Uhr:

> > I don't think a unified conversion interface is that important.
> > The various structures used for mappings are just too different.
> > For example, alists and plists aren't real types, they are only
> > defined by their usage. Hash tables, on the other hand, are real
> > types, with a per-object comparison function, a non-nil empty
> > value, etc. These two kinds of objects are just too different
> > to treat uniformly. Also, in most cases it is statically known
> > which kinds of objects are involved, so a generic function that
> > dynamically selects on the type of object isn't that useful.
> >
> > How about adding some simple conversion functions to subr.el such as
> >
> > (defun alist-to-hashtable (alist &rest keys) ...)
> > (defun hashtable-to-alist (hashtable) ...)
>
> Which brings us back to the very first msg of this thread -
> the bug report.  Please see the code I proposed there.
>

OK thanks. I think your definitions would be a useful addition to subr.el.


>
> And note the differences from the signature you show for
> `alist-to-hashtable'.  I think those differences are
> important and your signature is not satisfactory.
>

NB, I have the `&rest keys` in my arglist, with similar intentions as your
definition.

[-- Attachment #2: Type: text/html, Size: 1882 bytes --]

  reply	other threads:[~2017-12-30 21:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  0:25 bug#28753: 25.3; Functions to get alist from hash table and vice versa Drew Adams
2017-10-09 13:20 ` Michael Heerdegen
2017-10-09 14:11   ` Drew Adams
2017-10-11 16:42     ` Drew Adams
     [not found]       ` <87wp4038m0.fsf@web.de>
2017-10-12 13:27         ` Nicolas Petton
2017-10-12 13:46           ` Michael Heerdegen
2017-10-12 14:36           ` Drew Adams
2017-11-06 16:19             ` Drew Adams
2017-11-07  0:46               ` Noam Postavsky
2017-11-07  2:24                 ` Drew Adams
2017-11-07  2:51                   ` Noam Postavsky
2017-11-07 13:28                 ` Michael Heerdegen
2017-12-30 20:40                   ` Philipp Stephani
2017-12-30 21:08                     ` Drew Adams
2017-12-30 21:15                       ` Philipp Stephani [this message]
2017-10-12 15:56           ` Noam Postavsky
2017-10-12 13:30       ` Nicolas Petton
2022-04-22 13:18   ` Lars Ingebrigtsen
2022-04-22 15:21     ` Drew Adams
2017-12-30 21:26 ` Philipp Stephani
2017-12-31  0:01   ` Drew Adams
2018-03-04 19:17     ` Philipp Stephani
2018-03-05  0:01       ` Drew Adams

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=CAArVCkSGV19P9tu2eamHrjaFN3ve0XUHrvTFMdUhNYoObiXKrw@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=28753@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=michael_heerdegen@web.de \
    --cc=nicolas@petton.fr \
    --cc=npostavs@users.sourceforge.net \
    /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).