From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 06:34:26 2019 Received: (at submit) by debbugs.gnu.org; 9 Apr 2019 10:34:26 +0000 Received: from localhost ([127.0.0.1]:50592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDo5B-00017d-Lz for submit@debbugs.gnu.org; Tue, 09 Apr 2019 06:34:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDo5A-00017O-3d for submit@debbugs.gnu.org; Tue, 09 Apr 2019 06:34:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:37829) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hDo54-000081-UO for submit@debbugs.gnu.org; Tue, 09 Apr 2019 06:34:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDo53-0008Rk-Ui for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 06:34:18 -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.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDo53-00006l-0s for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 06:34:17 -0400 Received: from mail234c50.megamailservers.eu ([91.136.10.244]:55796 helo=mail37c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hDo50-0008SO-Np for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 06:34:16 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1554806051; bh=xfn0M9yntf8tzfgDvNI8deA8+LeBE/BbT3N7VlLia0g=; h=From:Subject:Date:To:From; b=YY8qYs0b7153ih8DV02+WbBiVAqjA5Q2yelMeNKwWqgb2J8B3/XFUvxOxgPXK8wcM b4poJnDLGJbrYzbm1gVVzqIkN1cvnSYS66xZtiVHhysuCLYErakB4Z8A8B55xu0pqn Z/kt81COnilf6JB/2ADe+k3X2TDab3dqGrRNgb6s= Feedback-ID: mattiase@acm.or Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x39AY9Nw016034 for ; Tue, 9 Apr 2019 10:34:11 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_00054EE5-5896-460D-8274-3C58FEECBAED" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: [PATCH] Misleading `list-get' argument description Message-Id: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> Date: Tue, 9 Apr 2019 12:34:09 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0212.5CAC7523.0052, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=P4AUeBIu c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=6mM8A04KtBac0AcifZkA:9 a=CjuIK1q_8ugA:10 a=3AWlWoJxXYAfIhdo_BkA:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.244 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit 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: -0.0 (/) --Apple-Mail=_00054EE5-5896-460D-8274-3C58FEECBAED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The doc string for `list-get' says Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'. which is misleading since it's an equality predicate, not a look-up = function, and the default is `eq', not `assq'. How about changing it to Equality is defined by TESTFN or by `eq' if nil or omitted. --Apple-Mail=_00054EE5-5896-460D-8274-3C58FEECBAED Content-Disposition: attachment; filename=0001-Clarify-the-TESTFN-argument-to-alist-get.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Clarify-the-TESTFN-argument-to-alist-get.patch" Content-Transfer-Encoding: quoted-printable =46rom=200bdfa84e6c55ff97286818b42ed3e6f035d47151=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Tue,=209=20Apr=202019=2012:27:30=20+0200=0A= Subject:=20[PATCH]=20Clarify=20the=20TESTFN=20argument=20to=20= `alist-get'=0A=0A*=20lisp/subr.el=20(alist-get):=20Clarify=20the=20= meaning=20of=20the=20TESTFN=20argument.=0AIt's=20an=20equality=20= predicate,=20not=20a=20look-up=20function.=0A---=0A=20lisp/subr.el=20|=20= 2=20+-=0A=201=20file=20changed,=201=20insertion(+),=201=20deletion(-)=0A=0A= diff=20--git=20a/lisp/subr.el=20b/lisp/subr.el=0Aindex=20= 45b3916196..5eb6a53f78=20100644=0A---=20a/lisp/subr.el=0A+++=20= b/lisp/subr.el=0A@@=20-781,7=20+781,7=20@@=20Elements=20of=20ALIST=20= that=20are=20not=20conses=20are=20ignored."=0A=20(defun=20alist-get=20= (key=20alist=20&optional=20default=20remove=20testfn)=0A=20=20=20"Return=20= the=20value=20associated=20with=20KEY=20in=20ALIST.=0A=20If=20KEY=20is=20= not=20found=20in=20ALIST,=20return=20DEFAULT.=0A-Use=20TESTFN=20to=20= lookup=20in=20the=20alist=20if=20non-nil.=20=20Otherwise,=20use=20= `assq'.=0A+Equality=20is=20defined=20by=20TESTFN=20or=20by=20`eq'=20if=20= nil=20or=20omitted.=0A=20=0A=20You=20can=20use=20`alist-get'=20in=20= PLACE=20expressions.=20=20This=20will=20modify=0A=20an=20existing=20= association=20(more=20precisely,=20the=20first=20one=20if=0A--=20=0A= 2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_00054EE5-5896-460D-8274-3C58FEECBAED-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 07:00:42 2019 Received: (at 35206) by debbugs.gnu.org; 9 Apr 2019 11:00:42 +0000 Received: from localhost ([127.0.0.1]:50610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDoUb-0001ol-US for submit@debbugs.gnu.org; Tue, 09 Apr 2019 07:00:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDoUa-0001oZ-1J for 35206@debbugs.gnu.org; Tue, 09 Apr 2019 07:00:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDoUU-0000G0-BU; Tue, 09 Apr 2019 07:00:34 -0400 Received: from [176.228.60.248] (port=2923 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hDoUS-0007W3-Ch; Tue, 09 Apr 2019 07:00:33 -0400 Date: Tue, 09 Apr 2019 14:00:29 +0300 Message-Id: <83ef6b78aa.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-reply-to: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Tue, 9 Apr 2019 12:34:09 +0200) Subject: Re: bug#35206: [PATCH] Misleading `list-get' argument description References: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35206 Cc: 35206@debbugs.gnu.org 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 (-) > From: Mattias EngdegÄrd > Date: Tue, 9 Apr 2019 12:34:09 +0200 > > The doc string for `list-get' says > > Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'. > > which is misleading since it's an equality predicate, not a look-up function, and the default is `eq', not `assq'. > How about changing it to > > Equality is defined by TESTFN or by `eq' if nil or omitted. IMO, this has a problem similar to the original text: it has nothing to "connect" it to the main part of the doc string, which is this: Return the value associated with KEY in ALIST. Neither "look up" nor "equality" is directly and obviously related to "associated with". E.g., you probably like "equality" better because your mental model of "associated with" is a test for equality; however, someone else might prefer the current text because they think of "looking up" in the same situation. But the text doesn't make the relation explicit, and that is IMO its main problem. Can you think of a change that would resolve this problem? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 07:26:16 2019 Received: (at 35206) by debbugs.gnu.org; 9 Apr 2019 11:26:17 +0000 Received: from localhost ([127.0.0.1]:50628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDotM-0002WM-MP for submit@debbugs.gnu.org; Tue, 09 Apr 2019 07:26:16 -0400 Received: from mail227c50.megamailservers.eu ([91.136.10.237]:57850 helo=mail36c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDotJ-0002WC-La for 35206@debbugs.gnu.org; Tue, 09 Apr 2019 07:26:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1554809172; bh=y6n9dP8SGKMZt+a1xWHI7xs1tOukJCjRcmFJQA+coB4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=tD+EMecSQTHXIickS9+lscLHFcSbzOmjJdWHn6UIN0J5SsLfjEoDg/OHaxZ9F6Tc9 rD53RXLcoyQqg/Cjvqk7W2nkzsmmsIEQZoMjBtfLmIaA94q62u+e0IYIkYjFCiXjBt zm9ZWx0QRWlSily4OmD7KFvvcrDbkO/2ET9FtplU= Feedback-ID: mattiase@acm.or Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail36c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x39BQAX9028899; Tue, 9 Apr 2019 11:26:11 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: bug#35206: [PATCH] Misleading `list-get' argument description From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83ef6b78aa.fsf@gnu.org> Date: Tue, 9 Apr 2019 13:26:09 +0200 Content-Transfer-Encoding: 7bit Message-Id: <29604A23-C01D-4DE5-9D40-493EAC445056@acm.org> References: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> <83ef6b78aa.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0205.5CAC8154.0017, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=VpUN/d+n c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=mDV3o1hIAAAA:8 a=F2SvIRHeU-1e5bVewTMA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 35206 Cc: 35206@debbugs.gnu.org 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: -0.7 (/) 9 apr. 2019 kl. 13.00 skrev Eli Zaretskii : > > Neither "look up" nor "equality" is directly and obviously related to > "associated with". E.g., you probably like "equality" better because > your mental model of "associated with" is a test for equality; > however, someone else might prefer the current text because they think > of "looking up" in the same situation. But the text doesn't make the > relation explicit, and that is IMO its main problem. Good point. What about: Comparison of KEY against the car of each ALIST element is made using TESTFN, or `eq' if nil or omitted. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 07:45:41 2019 Received: (at 35206) by debbugs.gnu.org; 9 Apr 2019 11:45:41 +0000 Received: from localhost ([127.0.0.1]:50644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDpC9-00051o-2W for submit@debbugs.gnu.org; Tue, 09 Apr 2019 07:45:41 -0400 Received: from mail71c50.megamailservers.eu ([91.136.10.81]:54774 helo=mail92c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDpC6-00051e-Bw for 35206@debbugs.gnu.org; Tue, 09 Apr 2019 07:45:39 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1554810336; bh=Kg+aLqGudvO+QaZqDDQQDgrIvgMLByhWFHSQTrvIthY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=RUik3/uiypN2rl4A01DtDVavbFDEstpEHtaGAURodDvhjnEEbvPgXJ++xyEMMyhnL sv3Ht6VkpWvTnGsPwMKgKzniGZy6SSTY8puyzVZ5KEF2qZRlfJuZCEvnHdAqCWjmTp 5IYKimg7xRBc/HKVTMez4rW8zL/KeCgWCeVmgjoc= Feedback-ID: mattiase@acm.or Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail92c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x39BjYoW028175; Tue, 9 Apr 2019 11:45:36 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: bug#35206: [PATCH] Misleading `list-get' argument description From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <29604A23-C01D-4DE5-9D40-493EAC445056@acm.org> Date: Tue, 9 Apr 2019 13:45:34 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <75D164EF-3F6F-4E45-ADCB-7A6C25DF4453@acm.org> References: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> <83ef6b78aa.fsf@gnu.org> <29604A23-C01D-4DE5-9D40-493EAC445056@acm.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B020B.5CAC85E0.004C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=BrmzP7f5 c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=DoxgHHQnB-90Xm9wNRwA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 35206 Cc: 35206@debbugs.gnu.org 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: -0.7 (/) >=20 > Comparison of KEY against the car of each ALIST element > is made using TESTFN, or `eq' if nil or omitted. If no knowledge whatsoever of alists can be assumed on the part of the = reader, perhaps this would be better: "Return the value associated with KEY in ALIST. +The value is the cdr of the first element in ALIST whose car is equal = to KEY. If KEY is not found in ALIST, return DEFAULT. -Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'. +Equality is defined by TESTFN or by `eq' if nil or omitted. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 10:41:39 2019 Received: (at 35206) by debbugs.gnu.org; 9 Apr 2019 14:41:39 +0000 Received: from localhost ([127.0.0.1]:51836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrwR-0003UM-GT for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:41:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDrwQ-0003U6-Ac for 35206@debbugs.gnu.org; Tue, 09 Apr 2019 10:41:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDrwK-0006fs-MB; Tue, 09 Apr 2019 10:41:32 -0400 Received: from [176.228.60.248] (port=4715 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hDrwI-00014E-Ke; Tue, 09 Apr 2019 10:41:31 -0400 Date: Tue, 09 Apr 2019 17:41:28 +0300 Message-Id: <83a7gz6y1z.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-reply-to: <75D164EF-3F6F-4E45-ADCB-7A6C25DF4453@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Tue, 9 Apr 2019 13:45:34 +0200) Subject: Re: bug#35206: [PATCH] Misleading `list-get' argument description References: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> <83ef6b78aa.fsf@gnu.org> <29604A23-C01D-4DE5-9D40-493EAC445056@acm.org> <75D164EF-3F6F-4E45-ADCB-7A6C25DF4453@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35206 Cc: 35206@debbugs.gnu.org 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 (-) > From: Mattias EngdegÄrd > Date: Tue, 9 Apr 2019 13:45:34 +0200 > Cc: 35206@debbugs.gnu.org > > > > > Comparison of KEY against the car of each ALIST element > > is made using TESTFN, or `eq' if nil or omitted. > > If no knowledge whatsoever of alists can be assumed on the part of the reader, perhaps this would be better: > > "Return the value associated with KEY in ALIST. > +The value is the cdr of the first element in ALIST whose car is equal to KEY. > If KEY is not found in ALIST, return DEFAULT. > -Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'. > +Equality is defined by TESTFN or by `eq' if nil or omitted. This is much better, IMO. It is better than your previous proposal, because the text is simpler and thus more clear. However, a slight rewording would improve it even more: Find an element of ALIST whose `car' equals KEY and return its `cdr'. ... Equality with KEY is tested by TESTFN, defaulting to `eq'. IMO, this isn't about assuming knowledge, this is about being as explicit as reasonably possible about what the function does. (Strictly speaking, both your suggestion and mine still assume some knowledge about alists, because we never explain what is an alist, nor what is an "element" of an alist.) Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 10:59:54 2019 Received: (at 35206-done) by debbugs.gnu.org; 9 Apr 2019 14:59:54 +0000 Received: from localhost ([127.0.0.1]:51862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDsE6-0003wp-JM for submit@debbugs.gnu.org; Tue, 09 Apr 2019 10:59:54 -0400 Received: from mail151c50.megamailservers.eu ([91.136.10.161]:46030 helo=mail50c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDsE4-0003we-LD for 35206-done@debbugs.gnu.org; Tue, 09 Apr 2019 10:59:53 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1554821990; bh=OmTq83858+YbYbOF3gCZRHyrcdO699Io6rNZdyzAzI4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Lx5CfdOABhsP7EE583a5AhjtIZPsgAJX9x0Z3i8GaEjNq36jxG5fiPlQ5Q0QkpPi2 CYb2yvwrYAjursrgpMLwyDrL8Kr/ogRrmEY7f/lqKwpJu6XEG9JGO2EwhC/5dL6S/r UsFF6STAAY+tojK1WzjVm6D9KAHdN3KxP1y+Sexw= Feedback-ID: mattiase@acm.or Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail50c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x39Exmfs014166; Tue, 9 Apr 2019 14:59:50 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: bug#35206: [PATCH] Misleading `list-get' argument description From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83a7gz6y1z.fsf@gnu.org> Date: Tue, 9 Apr 2019 16:59:48 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <948BCACD-D6CE-46AD-A31A-82272AB1A077@acm.org> References: <77179D00-DAC7-41E9-BC76-4F0824DC57EF@acm.org> <83ef6b78aa.fsf@gnu.org> <29604A23-C01D-4DE5-9D40-493EAC445056@acm.org> <75D164EF-3F6F-4E45-ADCB-7A6C25DF4453@acm.org> <83a7gz6y1z.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B020B.5CACB366.005D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=ILEs9DnG c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=mDV3o1hIAAAA:8 a=J_sKoqKBZ7BRS39qZrwA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 35206-done Cc: 35206-done@debbugs.gnu.org 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: -0.7 (/) 9 apr. 2019 kl. 16.41 skrev Eli Zaretskii : >=20 > Find an element of ALIST whose `car' equals KEY and return its `cdr'. > ... > Equality with KEY is tested by TESTFN, defaulting to `eq'. Thank you, I pushed that change (except that I used "the first element" = instead of "an element" for precision). > IMO, this isn't about assuming knowledge, this is about being as > explicit as reasonably possible about what the function does. > (Strictly speaking, both your suggestion and mine still assume some > knowledge about alists, because we never explain what is an alist, nor > what is an "element" of an alist.) That's all right -- I was mainly concerned with the quite misleading = TESTFN description, and looked at the docs of similar functions (assq, = assoc). From unknown Sun Jun 22 17:13:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 08 May 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator