From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#50110: [External] : Re: bug#50110: 26.3; Doc of `assoc': TESTFN optional arg Date: Wed, 18 Aug 2021 18:41:00 +0000 Message-ID: References: <83y28y3anl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15707"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "50110@debbugs.gnu.org" <50110@debbugs.gnu.org> To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 18 20:42:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGQVu-0003rh-TO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 20:42:11 +0200 Original-Received: from localhost ([::1]:43608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGQVt-0001f4-N6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 14:42:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGQVm-0001eh-I7 for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 14:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGQVm-0007Ph-BQ for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 14:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGQVm-0007Ks-9F for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 14:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Aug 2021 18:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50110 X-GNU-PR-Package: emacs Original-Received: via spool by 50110-submit@debbugs.gnu.org id=B50110.162931207228139 (code B ref 50110); Wed, 18 Aug 2021 18:42:02 +0000 Original-Received: (at 50110) by debbugs.gnu.org; 18 Aug 2021 18:41:12 +0000 Original-Received: from localhost ([127.0.0.1]:57633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGQUx-0007Jn-Kk for submit@debbugs.gnu.org; Wed, 18 Aug 2021 14:41:11 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:14572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGQUs-0007JW-F6 for 50110@debbugs.gnu.org; Wed, 18 Aug 2021 14:41:09 -0400 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17IIWGOT014162; Wed, 18 Aug 2021 18:41:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=bI/W74aGls+8yYDjv1d3dz/g8xN7QYhiPX40+xMSHbY=; b=Cv1HhPMsZkoxQgJXodu/aZ+KieWVA/T5hlwVq3VPHUvz37EPiJgACzPrBhTODBPq3hbw FFm90f0jVHjLJ8xyk70AfOKSRWQBU5cI7dzT7fWnuatCiv6u7t/33gbJFE0pIk3kDdNQ 5ZmqYAq28KhSjKe4FvuKrSCvrDoPZQLyDTirQ8WdgHI4qbg1o0HhoJeg5KqKg4h7FE8q Vnd41PfeMLBDZ9PqoiSptJlDLWHcqGI1pOeM5yZv6I07x5zN2W7WI+pciobDuO/TjvZc 8TxdcadVovSlpQCm6acSt244MU2vjHOsQxaN2RUMRthuTx+FVb62pOvhSJYNJFpzFAHD sg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=bI/W74aGls+8yYDjv1d3dz/g8xN7QYhiPX40+xMSHbY=; b=zpUluIFnSGNhC0Zc/yoD/cH1umt5eLonQNbupOKvWRxjWYqBhV8WLf2SCpYJAje6akuF FRoglf0snQHiOqNN2+3CdRJvarJQqE1qHTbn1HKZkVxx1mQerECxBedUElAD9phv/XK/ zoC9j2MEVjCzW466tGDNYNYloIjjmxlylpW8CW2c6pIXRu9UEIOY9T1JAfPvpZbIxgaQ Z1ZzRHGvS8cp/8clVz4LZQPLRWHX6PhP8er1gOruYeiiwelxIL5//uTZm9YHllgsAJmK 5knENIn3cM26kJyE1JI5wQBDKMjwVaGNY7kMb+Dn2Ugy1T9myNIp2TJieNAcVZcobDAL xw== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3agu24hwu7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Aug 2021 18:41:04 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17IIV3ks107831; Wed, 18 Aug 2021 18:41:03 GMT Original-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by userp3020.oracle.com with ESMTP id 3aeqkwt1w9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Aug 2021 18:41:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mNKa0nEJoAVsRkARLlBxyJ3yJS5c2BbdPivsIGYxHT52jup4BmG0CPirhJD+DvCVJf9n9HxyAadbXBhx3uKx1ApEWfdR1qV0B6H5q5AM71zveEqXqZ1eTH5sE80/G2lurbu3LqmHf7DDwMpgcLtNIW7LEt3vlmrdiKd/8WLjlx6xQ5uRLQc04W/18qDF8sAEiRb01lONbWea2wD3WN33X7KOar6QP8OEBDg7vM4X7RkJTosZdMWHc5KACwYpMjFtwiPywP6tHrTtGR013jPpB43QcfVhLWqDbwHyVvcz2SJCLDEIOqEvLm4R/1f5dk8S6NjWDT7Cs5dAJ+l3+W1CHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bI/W74aGls+8yYDjv1d3dz/g8xN7QYhiPX40+xMSHbY=; b=gdrd+qerarwh0O7jekIR9aeL2W8vYeAxHVGOk5+FHP8lf7Y3OL+TdVP8QTQfloWxcQX+vEwEdOet09dz48o+I+jc5HAKKI6Zi7bXi1ZeRqZPyDPZzmhz9qaMvnzr1KRzIOfjusXTzWdH8TIyXl7sv6eNnqUJU4jCAYQV6W3Mwg1SRugKmXWhxfECAvT2QqNng5dee2EuUVzFmUfSW5NnVvn2LMRWh4Ke4wVXAH3ppd53Ns4l0uU1cKdKcF7O/YAW7WnHMo2S1eH2RqMJKn3zDe+iEJgWH2g/OFTBkPH0wr3YRbJYzjxEfy6+iih/EqoBFERBuNCcdieUtmpAdG5loA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bI/W74aGls+8yYDjv1d3dz/g8xN7QYhiPX40+xMSHbY=; b=OJTV7op+xOTlgUAvhBrCxzOI4u1vxAM2ro3PaFghopsdCRPkaAhFIA7Gr8Ha4XXPKmut3p0bUZGYaoVuIyHpIl0NvB1FcUv8hCTkXGa+wb0rsxtNGpPPSZlZsARRB2UEAuuy7VsQ6HoPbY5YKnueqCx2kp5l3M3uKQAjq2ftpCk= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BYAPR10MB2646.namprd10.prod.outlook.com (2603:10b6:a02:aa::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.19; Wed, 18 Aug 2021 18:41:01 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a59e:fa26:ffe4:615b]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a59e:fa26:ffe4:615b%3]) with mapi id 15.20.4415.024; Wed, 18 Aug 2021 18:41:01 +0000 Thread-Topic: [External] : Re: bug#50110: 26.3; Doc of `assoc': TESTFN optional arg Thread-Index: AdeUV4A1o9NFT6AiQI6ApjK5kHgDBAAAgHOaAACJb3A= In-Reply-To: <83y28y3anl.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US authentication-results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=oracle.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8c64fbd3-9b09-448f-e9bd-08d96277ba03 x-ms-traffictypediagnostic: BYAPR10MB2646: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DKHa3Db1cSfSfEtRhFfYh/7L+SCH6CxzP2WxhwjOeKA8vyzMAODZ/KOhTo4JYKfM6bMVws5bFt/cagQcLQO1Ohty0spysC+bkkfqRcARlWOZrHqCME54aseqwk1pUFWtZx/GpINoCJK2XrAZ6Eq9O5eNv6XRerJYcDXYDacNLEWmRWBzLvqnLNFka8KBpQM02vBMu7SPfpE4n/V/fREBQwV4f5sGhyCZnLgrEBRFsrzEud8v7N/0xy+vA1CpgsuEIOGssU5FTf/H0hd7M3v6lDupzQ3Hz41654dNiLBtoIoszVaJ/TGS53TYiGT5fUU/Tof78FpZG1l/H14EP+ayZGagtmECv9EvnM8mkcvht6OTjyXzl2oKXehZTFmqqi/vjSe3axc1ETmW0z9DWtZ7WqTS9MHkWIZLnsYtl/idtUVIyZzSInYfqE+pEFxIAtMMJKsus3LHesGxPBqHvbGTyel/xRfwGsJ2Spyp303w6ewtaO86LFVSPBQ7EnUl0y8OhUBHc//F+WwamO1RGFpxiHykg/DqnLLlsF3wAZSmhnXUk6n+H3TfSfM9jgr3VNiAE/vMoeyGqLsIAdW6X/FUVm1h2biTCSkP54xKTrR7DK68HxePCLDeqZO5aFr6f81XanbYWsIDW8Raosd1lSFpA0Z5xtSdiH1ICmQcZlju/4kuu1f4h6WH1wFdhj3T2r37an8+7w+GHI9HRRN8cYzippFytcgh4j30T8JKhw50gE9ARN3caTtd9tidMGs/Q rNO2cr0exEXJq/puM6CjxWEBvLdIPnbPyyEW9wlZWyIV0+qnRkSA8iES34vrzAaEkzs x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(39860400002)(366004)(136003)(396003)(346002)(38070700005)(52536014)(33656002)(8676002)(38100700002)(2906002)(66946007)(9686003)(478600001)(316002)(86362001)(8936002)(71200400001)(186003)(66446008)(76116006)(66476007)(64756008)(6506007)(83380400001)(44832011)(966005)(5660300002)(4326008)(55016002)(26005)(7696005)(122000001)(66556008)(6916009)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: l06c5pdtm+7QR7jipAR5/Fi6QCENt5J7ZJDP96N8yA/IJDhfR3sKqAKB/Ig9XNykmkXm1KT7tI49B2rFPjs9k2KANZBQIga3deJtmZM+07WYfFnSyV79y3eMZvk2l2AZx/pmsd8IBHC0jieyze1JKiHizc+2FV5U5zHelf9cwKRPVVHHLY7XJqJk2OKkUJsJeKG0YxnpdKFBWwUPuHRfBXRcaBpPbdUez1KHs4WyD7e8ctp2QQSAsWI6+BdySuMSBAgYoRP+Yo4WiPUgYvEAWJCSTEPeOoUq6jeIwazyjtBupvhNA1BJYHrPVmbriizdJni3DqD67HpNy84RnLbm5+bPZBnKsd4vWgiWJunQHaPFY/3R2dAyh+MYwivlzqUdSx5krAxsDgRkhMjxgwTSS2iL1BVLkDSqTQtAzQE0ubJtrfTZDR1K4NUf6+bhdpy1KsOksKTL0NQS+PgIBb+iD94WR74zksGpQBv6yaDWvE80KNmAiVOZoJYKYflJcvtM/XZpXRP+h0CPOPit+30zBTliRaMmahxRaDvOja4f7yagvbZZKnJrTXzoLlL0BLlczK6XvRulvdaCDODHuDfVTAlOFx5+qLokx1O6nYW/HUvYlgIW40Ax58BXdRmh2ebnyKAT2qSSs5JP3pp0wiLvyxU3NLx/1R4MyT7uQcBAItVkrpDeAu0vIZetMYn7s3vxv0DwgyQ/tl9ejoUL4S40Q12UvqWcRyFhiamKeGipjb7uUE+AMb+PmESOp6 KOqyAMQgF9l2SIjHAbezN0VSXwtRynDzZNMl6kzdN38y3LZcpg79Egfiue1o17DyZeDTYy53Zbcsh0MAsn9p/wj9CbqbH0nIiM x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c64fbd3-9b09-448f-e9bd-08d96277ba03 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2021 18:41:00.9322 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1TbIaFDf+5vzLDKG71pmOQWcuEbjwac9GdPft7cJbORhMPduzB+50n03HvAZmqu0zxEQxnNg1EhCSo7aYSuBYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2646 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10080 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108180116 X-Proofpoint-GUID: 5liBYMCrKFUw1J6nxRoj8kXsTrVTcZAf X-Proofpoint-ORIG-GUID: 5liBYMCrKFUw1J6nxRoj8kXsTrVTcZAf X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212182 Archived-At: > > Neither the `assoc' doc string nor the Elisp manual, node `Association > > Lists' explains the order of the args that get passed to TESTFN. >=20 > It's a function that tests 2 objects for equality, so why does the > order matter? >=20 > > It's just as reasonable to expect that the pattern is the first arg to > > TESTFN, instead of, as is actually the case, the second arg. >=20 > There's no "pattern" in the doc string, so I don't think I understand > what you are describing here. I gave examples. What part is unclear? To know how to use `string-match-p' for testing you need to know the arg order for TESTFN. The arg order matters for `string-match-p'. IMO, it's an arbitrary predicate that's applied to 2 args, one of which is the car of an alist element. It's not necessarily an _equality_ predicate. You're may disagree, but I think it would be more helpful to document which TESTFN arg corresponds to the alist element cars. FWIW, here's a user who ran directly into this doc problem, which motivated this doc bug report: https://emacs.stackexchange.com/q/68172/105 FWIW2, Common Lisp specifies the order, and in fact it is the reverse of the order used by TESTFN in Elisp. See here: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node141.html#SECTION00180000= 0000000000000 This text: In the following function descriptions, an element x of a sequence "satisfies the test" if any of the following holds: * A basic function was called, TESTFN was specified by the keyword :test, and (funcall TESTFN item (KEYFN x)) is true. This would mean you would pass just predicate `string-match-p', not (lambda (x y) (string-match-p y x)), as TESTFN for the example. (Here, KEYFN would be the default, `car'.)