From unknown Sun Aug 10 16:47:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28876: 26.0; (elisp) `Hash Tables': hash table vs alist 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: To: 28876@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150825517121860 (code B ref -1); Tue, 17 Oct 2017 15:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Oct 2017 15:46:11 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 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 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 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 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 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 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 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 MIME-Version: 1.0 Message-ID: <7b57e08d-96a4-4887-bd25-afe9e9587c09@default> Date: Tue, 17 Oct 2017 08:45:49 -0700 (PDT) From: Drew Adams X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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'' From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 21:18:59 2017 Received: (at control) by debbugs.gnu.org; 21 Oct 2017 01:18:59 +0000 Received: from localhost ([127.0.0.1]:52915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5iRH-0001QV-Jd for submit@debbugs.gnu.org; Fri, 20 Oct 2017 21:18:59 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:56905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5iRF-0001QF-Qt for control@debbugs.gnu.org; Fri, 20 Oct 2017 21:18:58 -0400 Received: by mail-io0-f181.google.com with SMTP id m81so14963228ioi.13 for ; Fri, 20 Oct 2017 18:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=8G8jNfQVfjXN6nk4bjkPpazg93LEZ2eUughYbLo+rVs=; b=ReBqMgp1xTvBNWvBM2881oBlb9mudFjZoALhPnLBxxaQwxFXCs6mI4xNwtP3Aij1VL GHHuaT+F67w/AePOINkvI2IGnJfqWaHfw5JwugAaMwnwFbGAaRA85x1htTL1vR8qAn4v /BUq/yjfRWugkE22APlgmMcQZkkr9whhGCFQmKS1z9xHV28jnBb5eu/N5GSsPV1hzPqF 2xr6d4Lbt2HaePjy1cvaT4HQtLm+Faflv9xMQ8Aytk5+jIoiQrAePYACeOAoER3CnN2Q P6MyxBLPU3x82XQmtgPySplUrJqFxidAYxM5PL/G0CbYmLAuuBTxhbVY4D+1fAapWZRm pl/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=8G8jNfQVfjXN6nk4bjkPpazg93LEZ2eUughYbLo+rVs=; b=FccPJBIBmNBSrJoz4KI/Z7VyiKIxT6JkQa9FDaDhitF2CaMw6CnKjhHJsnJRzMHaIh mzvwrotiUygHB7JOqEuQyIrbYRSLuif/lNbu/RIvCu1JWCvpv3GGmZZS0PVInPIpcXti 2ortcdWlF6+zdfG/GsQLgs+8LSTsDlVP+YMCzzgQe7Z59CggQTw0ECbWwRV+rRRwgkzt ZBpWf7uTqizE+W+c49R0v5dVnqXF7MKwI35QbqiLHRIM6gMccqy7kRwA6tqQH6QnDeYk pF0C9NZHfPHQVGVSepsgxsCjxujW8PigSJDiwacCQqgN5lEOvSVSpOmdvXsIG0GqmNF7 /i7A== X-Gm-Message-State: AMCzsaVa83rog7ir4w87Oir+IaJcAAHUbj4VjVLtFaT0YXdEw1lJAXKT 0YMR7pAGmgZ3jeHGySFFmiZcLA== X-Google-Smtp-Source: ABhQp+SICMw53yRBzS37c8Mf8GfXfpGy+EYyiniuZwrX69bWt1rMkCHaETMhqJjI+Qn2H2LL3sbJOQ== X-Received: by 10.107.53.131 with SMTP id k3mr8735725ioo.199.1508548731929; Fri, 20 Oct 2017 18:18:51 -0700 (PDT) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c13sm1104327itd.32.2017.10.20.18.18.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 18:18:50 -0700 (PDT) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message for bug #28877,28876 docbugs Date: Fri, 20 Oct 2017 21:18:49 -0400 Message-ID: <87r2txe1s6.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) user emacs usertag 28876 documentation usertag 28877 documentation severity 28877 wishlist severity 28876 wishlist usertag 28897 documentation usertag 28817 documentation usertag 28609 documentation retitle 28609 simple.el docstring grammar fixes usertag 28736 documentation usertag 28801 documentation usertag 28388 documentation usertag 28237 documentation usertag 28196 documentation usertag 28070 documentation quit From unknown Sun Aug 10 16:47:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28876: 26.0; (elisp) `Hash Tables': hash table vs alist Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2019 08:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28876 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Drew Adams Cc: 28876@debbugs.gnu.org Received: via spool by 28876-submit@debbugs.gnu.org id=B28876.15706100251973 (code B ref 28876); Wed, 09 Oct 2019 08:34:01 +0000 Received: (at 28876) by debbugs.gnu.org; 9 Oct 2019 08:33:45 +0000 Received: from localhost ([127.0.0.1]:52094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI7Pk-0000Vl-Lc for submit@debbugs.gnu.org; Wed, 09 Oct 2019 04:33:44 -0400 Received: from quimby.gnus.org ([80.91.231.51]:57302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI7Pf-0000VX-Rw for 28876@debbugs.gnu.org; Wed, 09 Oct 2019 04:33:43 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iI7Pc-00051c-Bm; Wed, 09 Oct 2019 10:33:38 +0200 From: Lars Ingebrigtsen References: <7b57e08d-96a4-4887-bd25-afe9e9587c09@default> Date: Wed, 09 Oct 2019 10:33:35 +0200 In-Reply-To: <7b57e08d-96a4-4887-bd25-afe9e9587c09@default> (Drew Adams's message of "Tue, 17 Oct 2017 08:45:49 -0700 (PDT)") Message-ID: <87v9synwrk.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Drew Adams writes: > 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 t [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Drew Adams writes: > 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.) An alist is a list that associates keys with value. There may be several identical keys in the list, but that is not how an alist is meant to be used, which is reflected in how the common operators on alists work -- they only return the first match. So I don't think this is a difference that needs to be pointed out here. > 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. The primary difference is in the performance characteristics, so I don't see anything that needs changing in that node. Closing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 09 04:33:47 2019 Received: (at control) by debbugs.gnu.org; 9 Oct 2019 08:33:47 +0000 Received: from localhost ([127.0.0.1]:52097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI7Pm-0000Vz-W9 for submit@debbugs.gnu.org; Wed, 09 Oct 2019 04:33:47 -0400 Received: from quimby.gnus.org ([80.91.231.51]:57318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iI7Pk-0000Vk-Ru for control@debbugs.gnu.org; Wed, 09 Oct 2019 04:33:45 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iI7Pi-00051m-6o for control@debbugs.gnu.org; Wed, 09 Oct 2019 10:33:44 +0200 Date: Wed, 09 Oct 2019 10:33:41 +0200 Message-Id: <87tv8inwre.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #28876 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 28876 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 28876 quit From unknown Sun Aug 10 16:47:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28876: 26.0; (elisp) `Hash Tables': hash table vs alist Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Oct 2019 14:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28876 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 28876@debbugs.gnu.org Received: via spool by 28876-submit@debbugs.gnu.org id=B28876.157063248212060 (code B ref 28876); Wed, 09 Oct 2019 14:49:02 +0000 Received: (at 28876) by debbugs.gnu.org; 9 Oct 2019 14:48:02 +0000 Received: from localhost ([127.0.0.1]:53831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIDFx-00038P-Sk for submit@debbugs.gnu.org; Wed, 09 Oct 2019 10:48:02 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iIDFv-000387-NL for 28876@debbugs.gnu.org; Wed, 09 Oct 2019 10:48:00 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x99EgTIG104639; Wed, 9 Oct 2019 14:47:53 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-2019-08-05; bh=rmVGhBxcpPXyv/UdDf3hDyiT+wwaQbek3M/mHjHmWLg=; b=aOo77NtaOvleiJmot0II0lJfBFM5DnN1Glp4mqEdPuuvlQISHHwj35564omtif0NfKEE A1fg2X0Jq3Oe82YFCvnCcjmmPFsH0y1yaQAZm8qnwKA8YE3P6h/vVgKgMW5wRhdcKdRP PPWe+mO9nikm4Y2pexzgfsaJwfTm3MtxQdjNI7zwCJeLbbMa/uUR36WQs1BgHrzx5O6e gO+focFxU3+AgqJTos41VBtStTHb+zW0s/lM7FeT0wrbfpaCtHO8FnnO31yi5OBXGDgR 4m4KWX+406AmYJQ5sHj8GIqRzDCoHh5f7uGmdoKTrpWPDxDTs1Tf0wMIjY5gUPmzApJH Kg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2vektrmwph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Oct 2019 14:47:53 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x99EgJeN159617; Wed, 9 Oct 2019 14:47:52 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2vh8k0w8dj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Oct 2019 14:47:52 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x99Elp6c001797; Wed, 9 Oct 2019 14:47:51 GMT MIME-Version: 1.0 Message-ID: <24dd23c7-ae35-49d0-b570-06850bea6103@default> Date: Wed, 9 Oct 2019 07:47:50 -0700 (PDT) From: Drew Adams References: <7b57e08d-96a4-4887-bd25-afe9e9587c09@default> <87v9synwrk.fsf@gnus.org> In-Reply-To: <87v9synwrk.fsf@gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4900.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9405 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910090141 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9405 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910090141 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > 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.) >=20 > An alist is a list that associates keys with value. There may be > several identical keys in the list, but that is not how an alist is > meant to be used, which is reflected in how the common operators on > alists work -- they only return the first match. That is _exactly_ how an alist is meant to be used. And not understanding that is precisely the problem here. The point of using an alist is that you can, and you typically will, have multiple entries with the same key, AND that only the first one is returned by the specifically-alist access functions. An alist is not a hash table, and this is one of the most important differences. > So I don't think this is a difference that needs to be pointed out here. That's unfortunate. > > 2. Wrt the difference between an alist and a hash table, the emphasis i= n > > 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. >=20 > The primary difference is in the performance characteristics, so I don't > see anything that needs changing in that node. No, the primary difference is not in the performance characteristics. And even those can be more complex that what is presented here. Users used to other languages too often assume that an Emacs-Lisp hash table will be more performant than an alist, at least for a large set. Things are not so simple. The primary difference is structural. It is especially that an alist is a Lisp _list_. > Closing. That's too bad.