From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#28753: 25.3; Functions to get alist from hash table and vice versa Date: Sat, 30 Dec 2017 21:15:34 +0000 Message-ID: References: <54ecd1bb-0c84-4b0a-b19e-3a89cbe832bc@default> <87r2uce9u8.fsf@web.de> <3da0f75d-6000-410d-9e0b-ea293677b5ed@default> <87wp4038m0.fsf@web.de> <87r2u8sdh5.fsf@petton.fr> <52a5f9a9-2fd9-49a6-9dd1-849f3c18b519@default> <87wp326hla.fsf@users.sourceforge.net> <87d14uusjn.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1147e32c8e21e8056195403f" X-Trace: blaine.gmane.org 1514668465 2801 195.159.176.226 (30 Dec 2017 21:14:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Dec 2017 21:14:25 +0000 (UTC) Cc: Michael Heerdegen , Nicolas Petton , 28753@debbugs.gnu.org, Noam Postavsky To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 30 22:14:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVOSN-00007M-J4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Dec 2017 22:14:15 +0100 Original-Received: from localhost ([::1]:40355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVOUM-0000qh-Au for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Dec 2017 16:16:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVOUA-0000q6-Ru for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:16:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVOU6-000126-8F for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:16:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49494) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eVOU6-000120-3t for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eVOU5-0008Gl-Rp for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2017 21:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28753 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28753-submit@debbugs.gnu.org id=B28753.151466855131765 (code B ref 28753); Sat, 30 Dec 2017 21:16:01 +0000 Original-Received: (at 28753) by debbugs.gnu.org; 30 Dec 2017 21:15:51 +0000 Original-Received: from localhost ([127.0.0.1]:58175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVOTv-0008GG-EY for submit@debbugs.gnu.org; Sat, 30 Dec 2017 16:15:51 -0500 Original-Received: from mail-qk0-f180.google.com ([209.85.220.180]:45359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVOTu-0008G2-2z for 28753@debbugs.gnu.org; Sat, 30 Dec 2017 16:15:50 -0500 Original-Received: by mail-qk0-f180.google.com with SMTP id o126so43703230qke.12 for <28753@debbugs.gnu.org>; Sat, 30 Dec 2017 13:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XzhEvRUDe75Lf8zWZcAX+ktphyfmJMiEag8S2p+bJK0=; b=E+T0h6m0TJ7tAGFt99T5DSIsOXDmrPWdaRpyiC5b47MMCni7UFZ4jlv5WG8KAYZdXn u5smZyt3L8re95iwwi/s0c69deYe97hXzu1fYZy1C77W4cWljhBpGRtobCDaqheXzbbD qwApZ5B3s+ONTi6IE6o5hhWDD9vtgYfPfLLsXbJyvTmKJ9mJik3YPRTwo1hnkdIffves tuyFrAFAxcYz2mE/qcw5C0K4VwgG08+TY/a42hkeD21HZ/3Z5F9Pw4LjAVwqqyZSDgxl 2k/9mK19akiHFnCU9HuM+GVBnTmJorvK4I1sFBw2TL/3/6SsFUvt2VlNWuBPRI5ZGaJD HKVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XzhEvRUDe75Lf8zWZcAX+ktphyfmJMiEag8S2p+bJK0=; b=ov260yXR7L0EV19cE7dXhHzzrI4ZvY6UbNZDiYX4uYldmijed3D994WRyragQRpWk0 hQgqdpOTIsRC03NTD5MEv4k20G6cQHRHmsv116Ee6ZezdYziuWocH1LbRnHH0LRwoKxG sfaiLQfVjAq+hg0IpcK1u+HeaEYUYJFcxiJKepGpS0M3iqmZ9C8TGSzTX1g8aNX94X3Z MsnU8zvSGticYO7kWxShsVfdMDLzU6ovOVECoGBxdDwjBEEHvOnEAAc9iJVGehEjZr6j PSXb9hlbDTLFS6hiXqWIyN/YYH9uRjl5zU75p8hUa0zSd+y2EtKbI1iD19mVo3kTzvsq J1Nw== X-Gm-Message-State: AKGB3mKob8P/8ehX0VC+/uX7MYg4GkV90Lj1hnXGYg9ENaASXwaeJ54r vsIjFyYXAMkQNLTMT7yxqatw0B8StE7HJ6jEKrA= X-Google-Smtp-Source: ACJfBot0X8q8QfA3ZVv6BpGktaHQcF0yv+sNe6VCWYm331Urn2+BvhDk5d9Uk6YNFHLNDRqgvmE17tOJPF2Y1xDUBY0= X-Received: by 10.55.31.96 with SMTP id f93mr52130705qkf.151.1514668544628; Sat, 30 Dec 2017 13:15:44 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141631 Archived-At: --001a1147e32c8e21e8056195403f Content-Type: text/plain; charset="UTF-8" Drew Adams 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. --001a1147e32c8e21e8056195403f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Drew A= dams <drew.adams@oracle.com= > schrieb am Sa., 30. Dez. 2017 um 22:08=C2=A0Uhr:
> 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) ...)=C2=A0
> (defun hashtable-to-alist (hashtable) ...)

Which brings us back to the very first msg of this thread -
the bug report.=C2=A0 Please see the code I proposed there.

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

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

=
NB, I have the `&rest keys` in my arglist, with similar inte= ntions as your definition.=C2=A0
--001a1147e32c8e21e8056195403f--