From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#28753: 25.3; Functions to get alist from hash table and vice versa Date: Sat, 30 Dec 2017 13:08:08 -0800 (PST) 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: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1514668039 31915 195.159.176.226 (30 Dec 2017 21:07:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Dec 2017 21:07:19 +0000 (UTC) Cc: Nicolas Petton , 28753@debbugs.gnu.org, Noam Postavsky To: Philipp Stephani , Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 30 22:07:15 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 1eVOLa-0007yu-KK for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Dec 2017 22:07:14 +0100 Original-Received: from localhost ([::1]:40141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVONZ-0007La-HD for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Dec 2017 16:09:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVONP-0007Js-EN for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:09:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVONK-0001Hq-FE for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:09:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49490) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eVONK-0001HW-Ag for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eVONK-00084l-5R for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2017 16:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2017 21:09:02 +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.151466810230981 (code B ref 28753); Sat, 30 Dec 2017 21:09:02 +0000 Original-Received: (at 28753) by debbugs.gnu.org; 30 Dec 2017 21:08:22 +0000 Original-Received: from localhost ([127.0.0.1]:58171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVOMg-00083c-Lv for submit@debbugs.gnu.org; Sat, 30 Dec 2017 16:08:22 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:46334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVOMf-00083H-PH for 28753@debbugs.gnu.org; Sat, 30 Dec 2017 16:08:22 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.21/8.16.0.21) with SMTP id vBUL8Fa1146232; Sat, 30 Dec 2017 21:08:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=kpcttGZyB1nFeueGJJ9zX1a5RjQF1Wz7FredZJLCzIg=; b=c9g06moVnpbp3m/ucdJWTfXs5DjojPP2godTBunXviRWxj+psm11ufp7VY8viay41XCO ZxmIOg9PQA2uUq5kUJ46vbNBOZ5xoleCLkYE0w7BO4QDyi3N1kskd7bOJup/CE2/R1mH HvvY4QGq4IFvl/ClZ157idXOLAThJnMhhkZElorKJs9r/RG1pwh8cCXZxQhUk2dL0cOf +qXYwGsWxxWkFeKDcDkUNUbwU62LU9bX7dAlwu2aRukI+uhauJ3Kf+I2lNaCbS8SDwxu Hvm1LdI/KJNhgPVnFz/BxacCfVkaEO9U99CevH8xPXcnuz0CA6zOLQsxHsALXFPgvLrP dw== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2f60aqgyt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 30 Dec 2017 21:08:15 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vBUL8Ebe011654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 30 Dec 2017 21:08:14 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vBUL8Dxg025401; Sat, 30 Dec 2017 21:08:13 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4627.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8760 signatures=668650 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=747 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712300312 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:141630 Archived-At: > 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 >=20 > (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. Please see the code I proposed there. 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.