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.devel Subject: RE: [External] : Re: cond* vs pcase Date: Tue, 6 Feb 2024 23:17:54 +0000 Message-ID: References: <87il32iwmm.fsf@posteo.net> <87o7cttu4l.fsf@posteo.net> <87o7cts9nc.fsf@posteo.net> <87v871qt5w.fsf@posteo.net> 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="14829"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "arthur.miller@live.com" , "emacs-devel@gnu.org" To: Philip Kaludercic , "Alfred M. Szmidt" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 07 00:18:55 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rXUiM-0003cP-Ch for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Feb 2024 00:18:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXUho-0005Ty-C4; Tue, 06 Feb 2024 18:18:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXUhm-0005Ti-Nc for emacs-devel@gnu.org; Tue, 06 Feb 2024 18:18:18 -0500 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXUhl-00056x-2F; Tue, 06 Feb 2024 18:18:18 -0500 Original-Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 416N3laj018044; Tue, 6 Feb 2024 23:18:15 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-2023-11-20; bh=7bGzZFXu81GHZhZfDSXNwOQzoX4dM8R6GPR/ZCfmQN8=; b=Mhlt0OgJ4KECHk+DlVnGMvvFhuy3T8JA3tGoU9KgkkK/rC9UCleY/avV0clqaSVauruv kvPffbTqgUgY9ZJ177Dil0LyqRQDSwRfuy6zsPN0l9wfjZgIQKn4KM3MJd+pVPwbLmXy o/t8JG71V83GC1Cy4AFBKJEAubem5tbD9pPXzhEcQaa8PyckqSpFGBb4yz0lAD9EsWpv 1GCHdeZPX+EkN7VbEM9U8JQx6tfT8oIFkVf5O5Zpw0KzyKi8U/yQ4cz1B+aQYxr7Puob riW7PRMHl/YUzXRm531y9cMqK7RAhY0l+rsTPeOBwI/5XKQzo6Ch3bzd4Oxyj/x2euTt XQ== Original-Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w1dhdgbeq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2024 23:18:14 +0000 Original-Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 416Mh9xn036843; Tue, 6 Feb 2024 23:18:13 GMT Original-Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w1bx84ss1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2024 23:18:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VFRBDGBSRtu3u6QTz/Sb1E68Pu0gMEfoqj969K9UIISIB1r0j3Agz5WnbQLC/BTGH0gkTvDRKQCjnZV2+W9PPPiUS3VqJfdaXwbPfIEimr34y3OEteRy3HqY4fJGARbYv0DI0CH2zHhllvyNf2ZQnFl6XjDsidxwNRsaY9d/PIF1oHrVqyhO7NBlqO3z7rN5/Sjh/5iVWWGFLDhrsYN0WX2b57POLC/bpRVIJ4eAVZUMyRIjG14H+j03Ke3Qr2WQbEZzoWqqUhIpfa39oktUgnu/wf3oFqUSTG88lycEwxJbr1bmVo28EkcMDhFPVNuF1oZY+cb2A4XH02uGPQVMFg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7bGzZFXu81GHZhZfDSXNwOQzoX4dM8R6GPR/ZCfmQN8=; b=ZW+LrOx319/GKu/C1w2K5bHXIMDA9Lr+2j8RvT3UUTR48z5kzUG1Z1xvJS+bfSOz506ycJCND/un9oiw4T+FE8DSChRoQqoZRmxIsoJf4Bw/4qrU3tU3qenLeAb5E3CEeL+GLsWhfYRTzhmzol7J1thYbHAe9wTaQknZYwgvqVYprA7I0eGyasQ6vWOTzrD3R05j0aTLPZUxs8jzMaMNJ81aBdsmY6OAqmr6Cthp3tkcXZMWvwaUfGnrNlVHr2O4AYH/9gIBl6GCpaJdGQpIgzeiPt4i3fWDRcPwq3sqGCisn6txApb7BdjxYr/PCaia1hYm6JZLdhVGjATMPQHuEw== 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=7bGzZFXu81GHZhZfDSXNwOQzoX4dM8R6GPR/ZCfmQN8=; b=RrN44ljLWOgXxNt5ij32Krr28om6bO/p2XEr1LxjnFMVgp8IdLUnUvVgIlChAfFzomWHbi4U0c+2RWGuIR5SgkosXNH9RMa9gz0KVPf7roleIuLy/Phn1lSHHRjHW2R7oK2lT4HS9XWB1YCuKXFBmRiwWzcj3c6y9OAqdJ+qky4= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH8PR10MB6669.namprd10.prod.outlook.com (2603:10b6:510:221::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 6 Feb 2024 23:17:54 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7eb0:e361:caf4:a410]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7eb0:e361:caf4:a410%4]) with mapi id 15.20.7249.027; Tue, 6 Feb 2024 23:17:54 +0000 Thread-Topic: [External] : Re: cond* vs pcase Thread-Index: AQHaWTRBBScspyL3z0G9qaEL+mFd77D91nHg In-Reply-To: <87v871qt5w.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH8PR10MB6669:EE_ x-ms-office365-filtering-correlation-id: de4f07ac-9389-4dec-8ad1-08dc2769d902 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4S+AFNW8MDwS+EUcdCN7WmT5m0UUwbpT7eiwIWt6mrWQy77MSHvwa6Flbdz4i+/XNnrvap9HVZbOMlpHfjFlcJJOrhmrl6hu50/Nslb1KEZOXa9vNl2G/96e8eN0UVXWdnnchaX0Zoll8b9+FE3a0U8rwJS9Tgu4pVpPYs7g9rAuJiGXgSBFAELlHzquq6efQGXqxwnOQKmSZHITSM0AV5xml3fzKlkc8pizMQHf/f+WRy22T7vtIxCxucThwkUL2aRl3NXc0ym/5R4/B6qHGwKr30QhhY9x/viBPXXhtD+gUNTOLwG5H2yxGEbEdZ9jAMWT7KRN6/nMonmYWCTXD7A4uku4crJK5emfmHOV0EQIbg2bcK8odqmMwtF+HUVyYSuW26YYrRcAxz78mNtT9V4diAqSIxOIXK+iCeFjQzLPv5n6Haq+h7LA0W1QXZEXYYLZhqVjDitaKnohJcwmo731XgsLboKYkTYabq5nsto9VA/cWT3n5/Q7E2LG5CrSTmmQJTioaYsfAxqumLHEv2mH0Bq4FOfo1nPiMl+jqSq4b2mHTkvdHJLGDDwdxGrju4II3Nzu39pugJaCniv7GG8fG2E9qXcQaW0TIllROfCGr3nK98wNe6/rUlPmhCf8 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:(13230031)(39860400002)(396003)(366004)(346002)(136003)(376002)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(33656002)(7696005)(6506007)(122000001)(55016003)(38100700002)(83380400001)(86362001)(26005)(41300700001)(4326008)(8676002)(52536014)(9686003)(8936002)(71200400001)(316002)(478600001)(2906002)(5660300002)(66556008)(54906003)(110136005)(66946007)(66476007)(66446008)(64756008)(76116006)(44832011)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tCPEiKts4CP65Rndu+ZUzhC/G9OwwgB1M/fPQAf32ejSHaF2PUpNQEwaVtk7?= =?us-ascii?Q?LsXaynaaxAH5AeUFEjZQSxlKMh5VFud1UgsJDHVj3bTCJHHlL8Oml4JKFju4?= =?us-ascii?Q?0RaU1hmmWSy37V/JcM03ZEdKEbgXPJWmiod/9Y4sNsRqUUFc6aIsZLPXIGAp?= =?us-ascii?Q?+HggcvJAPWAZa4pToW7NaY72QmL/Avr09Bgh6tuWruMK74DLxahf6xlhnaSr?= =?us-ascii?Q?mmA2w3uLZI8CfeeMS3WHQbIyeucLaBo9MRc47V8B0e8FnEgMX7JcrYstvnrE?= =?us-ascii?Q?itKx2sMmwQwCtlZpSyF/F+DbrWOvVjzyf8f7+VdqMK2oE1gE0wzalsAlnvnK?= =?us-ascii?Q?voM0rLDtURyXY08WHrVphqzYXjvnRwFODn1b67box322GM9MltQmgbVemwn6?= =?us-ascii?Q?zBU0qCg5WYlw4C9AfP4dyquMK0OBmHM8eyKk0mNp62MME8g2fXXEos403xGM?= =?us-ascii?Q?xqVsjLpQUL/H6mbdqBS7J6+yd1TOAjmjVshyfcp0JX8y6UeEFZ6X8xfGzFi/?= =?us-ascii?Q?6Tbp6LDjdHVhIEhhJrQRqC6kXhf7YBXNq/y8GyA5mNYmSErxHIE05UrOUhPU?= =?us-ascii?Q?OgavSdOn9amcR+oBFkkDhLdizxwH0WZg7QJPbYEUq6/vbje4fs2GAU0ni/xm?= =?us-ascii?Q?Qe X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: HGSQDw/B48zoR96THkcG8pAMY86xilhEQwwalSy7O3QMnx5JamsFJ6MZ/tCnF0gfe3wzz+8f4OzsB/1bHzeSmVcgQpzE8Iq5WhdRiqV4a/XcmOBvmto/H+ybMHd0J+xcFd+24xCVAHuif3NtkwVEnBg1dKxJsK2cCG06BgCJ9JtYRliUbdlUML5JpZsn0UWT/08LdSXSGvYS7X1G76YwYQ+qswueXq8WZQK+ZEwzECGryFY+CU6q0iLNOQtiQ7ZVlTxwjiUS/MA0c3TXxFIjDaDi4fEjbkF9gr1pxrXprQJ/jOsVK5qOWrlF17X1GF+/RXxKfcEKHfUozGsiwXccAOzlzvAKsuldbCniqME3unHo17n/iGGktZd3CSK08E2kIcZI2Pna9rmHpdY7YQrAz1+Wk3VpGSG/8x1CgI14LDlEvbXFMSQIswaJvrEqeUMmS8JRm2VdcLcrCgOTpKIbeo5vg0+I5csuMQIGjJ6mjRE8GxrLFIOkCOZj8QExq5iIvrg/PTUBxMtB4cjhrz0+NioBmX1Nned/Jh/5PPHY2ZtZpStElU9ZddHTihVABfAWEsXwcx1hZIji8Gj501s33Eh5+J/b05IXsHoWbEoZMo8= 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: de4f07ac-9389-4dec-8ad1-08dc2769d902 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2024 23:17:54.5390 (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: qWmtXtt6EF/HEoFeSodUDWo8WvrS8gW8I3PA+Xam0YXczNu8AEhA96b0l4LEJ1GH6uznQgL2p0Vv4FqtomEDew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR10MB6669 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-06_14,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxlogscore=893 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402060165 X-Proofpoint-GUID: ToQLApBDw3ixMyZI0Y8d2uQdIylNvCmm X-Proofpoint-ORIG-GUID: ToQLApBDw3ixMyZI0Y8d2uQdIylNvCmm Received-SPF: pass client-ip=205.220.177.32; envelope-from=drew.adams@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315950 Archived-At: > [`equal'] is not really slower than using `eq'... With this I agree completely. `equal' just calls `eq' first thing, whenever it can (and I imagine compiling even takes that out of the equation often). That said, _in such cases_ telegraphing the fact that the Lisp objects can and should be compared with `eq' _helps human readers_. With a slight stretch of language, this can fall under the heading of helping readers by expressing "intent". > The pattern matching code is all generated at compile-time, and even > uses the `eq' to compare symbols, instead of the less specific `eql' > (!). Yes. It's not about performance. > Yes, this might be a fundamental disagreement, but I > still don't think that using more abstract means to > solve a problem is inherently wrong. It's not "inherently wrong", if you're measuring "wrong" by performance - or perhaps even by some other criteria. > It might be a personal preference, but nothing > we could derive a general rule from -- which is fine. It is indeed a style question. But it doesn't follow that stylistic guidelines don't, or can't, or shouldn't exist. The existing, documented Elisp guidelines don't cover this. Nor do they cover other conventions such as using `when'/`unless' to telegraph that the returned value isn't important as such. They could, but they don't. Such conventions for conditionals do exist, and they're even mentioned in CLTL2, IIRC (though CLTL2 doesn't impose any style guidelines). So yes, it's a personal stylistic preference. Nevertheless, it doesn't hurt to discuss the reasons for such a style - or for other styles. Have we seen (here, now) any _reasons_ in favor of always using `pcase' when something else might do the job more simply? Have we seen an argument an argument in _favor_ of "using more abstract"? I can think of a couple, but they don't convince me in light of the "communicate intent" argument: 1. One can maybe save some time or effort by learning only one construct (`pcase'). One size fits all has a certain economy to it. 2. With `pcase', later updates might sometimes not require as much editing. I've never been an adoptee of the second. I prefer to have the code always express better the intent, even if that means I need to edit it more later, when things change slightly. This can easily be the case with conventions about when to use `if', `and', `when', etc., for example. A lot is in the eye of the beholder - the expected readers of the code. Higher-order functions such as `reduce' are elegant, and their use can be succinct, for example. (Elisp isn't a great fit for them, however.) But a reader needs to have been introduced to the genre. YMMV. Different strokes for different folks. More and less abstraction can each have their advantages, even for human readers (not to mention performance). =20