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: Wed, 7 Feb 2024 17:14:45 +0000 Message-ID: References: <822c332c-1a85-4454-8978-0b1491981058@alphapapa.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="7323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Adam Porter , "ams@gnu.org" , "emacs-devel@gnu.org" , "philipk@posteo.net" To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 07 18:15:46 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 1rXlWR-0001X6-0Z for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Feb 2024 18:15:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXlVo-0007wP-0u; Wed, 07 Feb 2024 12:15:04 -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 1rXlVk-0007vo-Pj for emacs-devel@gnu.org; Wed, 07 Feb 2024 12:15:01 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXlVi-0004Za-PO; Wed, 07 Feb 2024 12:15:00 -0500 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 417FxEKx009907; Wed, 7 Feb 2024 17:14:49 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=6G+nUuhiQdVmDMdYmp2x2Y2DTLad3UI2Nt1V1HDMmXM=; b=M8J+xBedHgaCwcpTo0/2HD1qeNtJmTFIJzlJZZ4pSlLsEoEdOkucOWREUGrLl47zHd4Q OiJUT/CWer79xqlQXoxDgDyfJt+ERguZo+sNBWAVL/rhNzfJ4g80Et+P0+GY9Bmfw1N4 cLMlQogXNplyM2roCuTqDQzl4u7cH4C/ot76teashgC8cWcSNOQFFpg+UKRY46yJNpUz 8LhjNNIRDT39aXusARJ0ZrDwZWbbjrA8jNvPj7o4C4K+wlnepl5cavQp0bo0HKUJ9mKv OrD5P2LEhuVZSxqkHZNisvH5gkNMaQl/MI2r8HFpFsXp0/zujstB7L+TPkXdL3CS/fcT Sg== Original-Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w1c32te44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Feb 2024 17:14:48 +0000 Original-Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 417GKDNd038468; Wed, 7 Feb 2024 17:14:48 GMT Original-Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w1bx9amgm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Feb 2024 17:14:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QW0C71NvHZGNKe4EzR8IlJ5IahUGwHnmpcSZolF64qrPpBLjzuRy4p17Wb7eEv5vHEefkGxLfoZjE32H8HCnhwp1R2ckaxENte0DsfoTUJ9Dxm9OMkplN+7qmesegVKfCWt4QIXASIslgLyhAVTqKnSyl3W0VK/nhz/yBbuEK74lwfu5PQgLSO+oyZTy8wAAE8v19Zvzq1T3sxL0I/YBLGNBFmKTvn94TbXhLX8QoR12TpQVOx1oljGHS+s1Wcdnx1xsQjac3zNGUf8opZAPaMUXZblxaepoa/Y0V7tdOGIqD/PAgPjSqUSw1OSPTeNsGKB2muiu9l1q8dvJb81ptQ== 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=6G+nUuhiQdVmDMdYmp2x2Y2DTLad3UI2Nt1V1HDMmXM=; b=amq4Ru3+DkKxOhNNs/hz1FuL1dG80AcdlQ0R4yJFUjtwlUCEe0CNAMz0svvrxaYSK2tEjoF+oucXy39XtHyykkXNOuBXW7an5BpNxoLDE/8Y7kjMH3WkDiBFUoIlHqE0mCJ9vouEU88jDtnV6UHtDceeaT3srxAfkcRbPjYLbZaJfUWMRgWuWvn/ZFktrTzmmo6xAgw6pCJWfuH17uCmleYRiaPhaVmV4a4t6wHT2+rcNWlCLdH6uLHImRPaNoPb386m1OZVIaxfpJy//XeZ5on5D7fJWlGZJwdy1miCkjaX6Jx/tyoZBob7e/RckUWn9ONV+t60347l04mZ6anWPg== 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=6G+nUuhiQdVmDMdYmp2x2Y2DTLad3UI2Nt1V1HDMmXM=; b=uhoyKw1YSJK0Ku7Y8IQ8Kbcwu2LnvB+2pbh7e6VnDYA3zjI2wGzEflDsG7yJCl1gNEuzCK8cS+Zx6NHjQDmiVQLm8GglBbpcaY2piiGn/x0sUaTXntOCgYnlH5KDVqtx91NkFdMvC6PCydhYs1L5EKYpjPRe/KvA7341TT1zCCY= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BLAPR10MB4932.namprd10.prod.outlook.com (2603:10b6:208:325::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.37; Wed, 7 Feb 2024 17:14:45 +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; Wed, 7 Feb 2024 17:14:45 +0000 Thread-Topic: [External] : Re: cond* vs pcase Thread-Index: AQHaWekk8aDmPOdXf0WASgu0Za9djw== In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|BLAPR10MB4932:EE_ x-ms-office365-filtering-correlation-id: 67790777-e17c-4eb9-eaf3-08dc28004841 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jbEGDwFMhXI55+9icuoEc3WeYbKyxtiESfMsN9Gbgw3OVWEN5OcJjFEikIKcF/JLTxlWc2ri/xhhF86Vxn0n9DYuxZEPz0UM+DWcSzCZOXvCzYCObj9K8LMhHrwRu63yLo7ScNFGm24Lucge9iXyCo/hdVde2LXkX0j8OpQi53ogi8+aJmy+WmkRS8heElmOubcmMp94cSDk78Xf8jjWqsJ4SD5Jk5n4lam+d5x5fxxub7DupNyJCpYIKLrjDtxfeXiZxgW53u4pGPzTT2+NAN1Q9PT1GRLviqRpaSlM4goxFMTwDbc186ofYs7cbCCMkn7T3iGvWwvHgSaYE4Pja8mOoQmA/LxPo28pFa+4xDJWkmP0M6+4aq/gloFTiPCV2MfWsaQRwinR47oFQznG1BOM+EFPjeKcSSvZgpi0IhJDfQUTjVYtjttVmz3rPorgV/pefgs/XiKUakyK4aoOhjl0w+oaKetOV1MCExbXilHQsRqZU7ojAuyZ7jpW6T0Xc9k4S2zJHRC3lTpFydBv7EJstcWH/s2mH/YIkLdWB4lUKttXt9gOJbXLbJ2Nd4B101STYuDL9gZg/ZORusKd4Ap9O//wt/hVmRgXMJ7V6zK/tEA73kBh6NEIocbcdxNX 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)(346002)(376002)(136003)(39860400002)(366004)(396003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(55016003)(66446008)(122000001)(7696005)(6506007)(33656002)(38100700002)(83380400001)(86362001)(26005)(41300700001)(9686003)(8936002)(52536014)(4326008)(8676002)(44832011)(71200400001)(2906002)(5660300002)(6916009)(66556008)(66476007)(54906003)(64756008)(66946007)(316002)(76116006)(478600001)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QIoKhj4H3CHTJqlbRRtHszZ9t4HW7vcQlFNLKuB7Jf1EtuEu61DCvEhwmda8?= =?us-ascii?Q?WiLOuhy6d2qeofT3nFF3k/eE1de+ZPajC8Wqvt555Ps2WVXZuKnEGuxyLbkE?= =?us-ascii?Q?LEtUw72rbcVBzix1sfhEeW5/37m0bQEz7L1FpClLVi8XKDliaEMWv+jV/JDO?= =?us-ascii?Q?ryZqTsB5KPe6QFw+vRj6EqgYTAW52pAnX7bnJcSX1ZlBpwhAE2IIaElqwaEn?= =?us-ascii?Q?f5M3Ra+GLvhiWLWJvly2SeE+wLP6Z7MO/okVGreDsT6SQqeFqbTmAsseiN8O?= =?us-ascii?Q?QvzHLn3hHPOyJBlI8fv3qrDOX185USeDrHyACkEzVybqkb7oJtYe/rgIR4IW?= =?us-ascii?Q?FI6cR002JVt1P1RhOv7+6Ld19PnxrsUai6QCEGFmSRa9Kdp5awqnFw2XO7dI?= =?us-ascii?Q?yJAYY4HSCf8BzA2i61LFqNwufeVZFz6oWTusOiBoiMEMkUrbUDL2iAgpx2Ie?= =?us-ascii?Q?vcyQdS865Cp53dWvCg70Oqojrm5waVslxsaG+UHZn61Zq7bFrOCjfCAwMmQ3?= =?us-ascii?Q?1TttpVFMjX9v2egMaGBlK14Gxeljqp/D6k77jUy397Vie+Pix+UNRNi54FMa?= =?us-ascii?Q?kLKwQuPpN9JSpIpKdsy63iVEhCEewZ5MBzWIPeu8cYzixSof6spTL7okQaci?= =?us-ascii?Q?fp X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ++9UrB2sOwNnqZiQL9lbzBgQ4Il6ulTJQHfS1PpgqeVK9BDNv/si6fokQVL0x1/H5V58KF4c3EZGOzoy0lG/Q3jzoprqnm/oj0JSei8ms6HbP1Enrq9n8uGuIcS6Kp9iXKVE+yusmrSrqwaF+hhSrszZVwKEp4occzXnaWBroTTwBIiaWSAGqoPAdNmF2s9vp+t5VDiPzBpGVGOXGDYVf4tfcSyVAKUg+iDmgpT/46jn+MjpgO5i6yGw5UCSULm5viGPeYh2wG2P+KuNRJxE2DOGHgQEAIW0yUAhZFpGje1iig8NA+Kh2cbOTWNftqbck7bqpAuCKTXNrGBJp8gRx77UrJPNCR9e0XQC04THAI2LPDCFVhfEyqulyKMGY1f/NKFTBfv2Yxuw1hDYFe5yLLciSeb9QK++yXT6nExABN+0aISdpCIPDgwV+KeUglhGBBJuS7Cn18ljFBaSEETSOhVTJnZG9FvTawLFivqVPcK2i7aBQ1sQ4CNBemDqIus6NlrwqLBkkh/7Mlb0ojwFD/xdyr8LnWt7HpfNzlwtmhXgzJhsFXIYb8OO6UrxhmjjxwKklRR0yXosM4LvmU/Ng3KZmDVDkC6qOokStJJdd4c= 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: 67790777-e17c-4eb9-eaf3-08dc28004841 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2024 17:14:45.6767 (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: UaFZpEMdVIY+d+RUUF0Fn6iJgFx1S9ImzxkERDncOSMJMxXBo9v04XpQcByb5Cy1ew+XlIenlZ4wFwr7Fxf0Qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4932 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-07_08,2024-02-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxlogscore=301 phishscore=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402070127 X-Proofpoint-GUID: T1A7ipL1xGmVKnZHszN_aMfsjk-mCuX8 X-Proofpoint-ORIG-GUID: T1A7ipL1xGmVKnZHszN_aMfsjk-mCuX8 Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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:315983 Archived-At: > > Don't use a jackhammer to drive in a carpet > > tack, if you have a tack hammer in your tool > > belt. (But sure, you can always use the > > jackhammer if you really want.) >=20 > I think it is more important to be consistent and > choose one form than many different if possible. The jackhammer is always "possible". That doesn't mean that always using it is the best way to help human readers of the source code. > This is a discussion like should I choose setq > vs setf. In the abstract, it is. But the question isn't abstract. This is about coding style. There's no documented Elisp coding guideline about this,=20 so it comes down to personal preference/style. > Prefering pcase over cl-case, mean you have one > place to lookup the documentation, one "special > form" to learn, and so for your users too. When the "One Way" results in overly complicated source code it can become an obstacle. Let a hundred flowers bloom. You code your way and I'll code mine. ;-) I'm the main, maybe the only, reader of my code. I use `if', `and', `when', etc., following the convention I related. I do that _so that I_ can=20 more easily read and understand my own code=20 (sometimes years later). I do that for the same=20 reason that I sometimes add a comment with the reasons behind some bit of code. It's about human communication. > It would be much better to have one function > that let us pass in comparison operator, say > like this: > (member element list &optional test-function) I agree. It would be good to have that (as in Common Lisp), and I've said so multiple times. That doesn't mean we should remove `memq'. And even if `memq' didn't exist, that wouldn't be a great argument against adding a `memq'. > I think it is more of peep-hole optimizing. Not at all. It's _not about performance_. Dunno why people don't get that. It's about human communication: code writer/reader. Just like comments and API doc. > "Signalling" something to someone by carefully > crafting use of cl-case vs. pcase sounds like a > lot of cognitive load on all involved parties No - the opposite. And no one's required to be sensitive to such nuances. *IF* you know about the convention regarding when to use `if', `and', `when', `cond',... *THEN* you can immediately tell (even feel) what's going on. This is as natural to code writers and readers as writing/reading (car foo) or (let...). *IF* you're unaware of, or not used to, that convention, *THEN* you just miss out on that immediate "intuition"/understanding of what's going on. You're not bothered at all. But yes, you at least need to know what each of `if', etc. does. That's really not hard. It's not hard to learn what `case' does. > You are basically saying that we should use a > high-level construct that helps us structure > our programs according to their implementation > not for their higher-level feature of singaling > intention of our code. I'm absolutely NOT saying that. I'm saying that communicating the intention of the code to human readers is important.