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#28876: 26.0; (elisp) `Hash Tables': hash table vs alist Date: Tue, 17 Oct 2017 08:45:49 -0700 (PDT) Message-ID: <7b57e08d-96a4-4887-bd25-afe9e9587c09@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1508255359 2296 195.159.176.226 (17 Oct 2017 15:49:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 15:49:19 +0000 (UTC) To: 28876@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 17 17:49:12 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 1e4U74-0007OY-R3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 17:49:03 +0200 Original-Received: from localhost ([::1]:40133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4U7C-0004VZ-0r for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 11:49:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4U5A-0002zR-Nl for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:47:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4U58-0002kF-4Q for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:47:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37809) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4U58-0002k4-18 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4U57-0005hm-Nj for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Oct 2017 15:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28876 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150825517121860 (code B ref -1); Tue, 17 Oct 2017 15:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Oct 2017 15:46:11 +0000 Original-Received: from localhost ([127.0.0.1]:46490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4U4J-0005gV-67 for submit@debbugs.gnu.org; Tue, 17 Oct 2017 11:46:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4U4H-0005gG-0g for submit@debbugs.gnu.org; Tue, 17 Oct 2017 11:46:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4U46-00027T-6a for submit@debbugs.gnu.org; Tue, 17 Oct 2017 11:46:03 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:48481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e4U46-00027P-2c for submit@debbugs.gnu.org; Tue, 17 Oct 2017 11:45:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4U44-00029U-Df for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:45:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4U41-00025Y-Nw for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:45:56 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:43664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e4U41-00024q-ER for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 11:45:53 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v9HFjpXS003871 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Oct 2017 15:45:51 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v9HFjph1027654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Oct 2017 15:45:51 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v9HFjonD000801 for ; Tue, 17 Oct 2017 15:45:51 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:138626 Archived-At: 1. Please consider saying explicitly that an Elisp hash table is not a multimap. This is another way in which it differs from an alist. An alist can have multiple entries that have exactly the same key (even `eq'). An Elisp hash table cannot - it realizes a mathematical function: one key gives you only one value. (The fact that `assoc' and `assq' ignore entries past the first is irrelevant here. An alist is a list; it can be used in many ways.) 2. Wrt the difference between an alist and a hash table, the emphasis in this node seems to be on the performance characteristics. I think that functional/structural differences should be distinguished here from performance differences, instead of just lumping them together in the same bulleted list. >From the perspective of using a hash table, certainly the performance (as well as the non-multimap characteristic) is important, and often decisive. But from the perspective of using an alist, the structure (as well as the multimap characteristic) is also important: Lisp programs manipulate alists as lists - they do not necessarily just use `assoc' or `assq' on them. This node seems to have been written by a hash table-only user, not a general Lisp user, who might use both hash tables and alists. Please consider expanding the description of the difference between the two, which means expanding on what is said about alists. I recognize that the main purpose of this node is to describe/introduce hash tables. But this is Lisp, so I think it is important to _really_ describe how a hash table differs, in its use, from an alist. An alist is a more general thingy - you can use it in ways that you cannot use a hash table. That BIG difference does not come across in this node, so far. In GNU Emacs 26.0.90 (build 3, x86_64-w64-mingw32) of 2017-10-13 Repository revision: 906224eba147bdfc0514090064e8e8f53160f1d4 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3''