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 19:12:17 +0000 Message-ID: References: <87il32iwmm.fsf@posteo.net> <87o7cttu4l.fsf@posteo.net> <87o7cts9nc.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="6036"; 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 Tue Feb 06 20:13:20 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 1rXQsi-0001LI-A2 for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Feb 2024 20:13:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXQs0-0005rz-Ty; Tue, 06 Feb 2024 14:12:36 -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 1rXQrz-0005rk-JW for emacs-devel@gnu.org; Tue, 06 Feb 2024 14:12:35 -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 1rXQrm-0001wJ-H9; Tue, 06 Feb 2024 14:12:34 -0500 Original-Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 416IT6Jv020033; Tue, 6 Feb 2024 19:12:20 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=FEauuwpMK8tlXEJC6Nw2yqN0vbAxTh4PHNoEnDnHUkA=; b=mRUsxmeQWu0Gc/KzxOX5Lr/dhO8nXQSkkp6sD/4rb3L0gBN0zI1RDMZK7HHupCSrEZXd K6oWOWDbSQS304qM5/U8hrBJUQufl++m6e5K3acu1cH3xPrJRRdChpc+MRXlgw64HudF aXo9SJjjLsEsLMM/DI0bTv0UGrYSZZchwj50MYBicHFyBXT0TrqFxS3Z3pptCNJCUg0c M05j1Y/tcRIKX3htZlxoJPuq0XEd/0oG3QeU7VwG1okuTFrBtLUpdFaPSYfzS90SjR99 nvbgJSW4cMAxW2pf2H9PewxfBtTBzZftEDYjyueZn2oAp9iPOLn7E/QcTpxj1oU2eeuC 9g== Original-Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w1bweqnuh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2024 19:12:20 +0000 Original-Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 416Imb2j007263; Tue, 6 Feb 2024 19:12:19 GMT Original-Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w1bx825b3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2024 19:12:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i2iWtwb4llPBEba2BlnDLeQKrxTZUCf/pSqK1e3HK5XH8ZfEqKRsKTqTh8SbzsL/x1TYnbVQNVT6R6HZsFH4fBPHJ3BGDGqKx8Qz9BzcebWEW7UZTXcQ1sChxN26foS/66LSFqy1IqcP01SmbLXc3pAPrTip7I3ATXD4MEl6THFtKvXhZ8S5vv+9HyplUpIIsVCe1RdPziwZ1Rd51b5RwJjyk417qHQqkCfwDpv5fSDbry6J1mhIjW+SEVXdAJdakjChAE7Bi7n/2CzHJD0iSw/Imu4kr9nYWyOecCGXH8U7sRI/Wj6q6k1RPzymFT+WDUfTp86fLAK8CJUkc+yPsA== 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=FEauuwpMK8tlXEJC6Nw2yqN0vbAxTh4PHNoEnDnHUkA=; b=KtY2B2RHB7LacxQDoq0Nmt4/+Sdj0WGTOA/69pEZW8RaXI44cldwt0f0MAne5QfiLej1NVuQC/mMZutRqyIYeA0HjWeaAW7xn5t7MxSx1frNNOfozUxxIssRrKADMXGDm5U51UGnTWO/BWoUlBy512nrfQcBKWCB0525E8tdv69j9WLb5pHVpllpp6G3vjd+O51HuLyqBpAQPzO6eJ9Wl4vtkLIQbx0KivLSLvyB4Hw1McD7vSPuD5IbpVuAuBSRAkpsDWYgLm4iS7SirHxLREz2q6CJ1GPoUlb11chy0ivtdnYbcfFCMrA6ltHc5xiJgNuPIGK0gdOj4q4GINWqxg== 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=FEauuwpMK8tlXEJC6Nw2yqN0vbAxTh4PHNoEnDnHUkA=; b=tU0RKmtmjb/Ogf+b9YNzofIG+ycS8eV3cD4saaeP/xWl0OQd2I13w+Ve5J8dVZoYDIYcYyCMdngayF2hmQgCc0yy/9YsKDtBcN76Iv6KgyxnVdLO0/SSaXKiKCOklLKYdxDdY12Bz3qfhYrvY6wQ24LZGUVV0kZ/h603LEkMa2E= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by LV3PR10MB7723.namprd10.prod.outlook.com (2603:10b6:408:1b0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Tue, 6 Feb 2024 19:12:17 +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 19:12:17 +0000 Thread-Topic: [External] : Re: cond* vs pcase Thread-Index: AQHaWS50bN7oSlFomEGctU0Ge2oDULD9q0bA In-Reply-To: <87o7cts9nc.fsf@posteo.net> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|LV3PR10MB7723:EE_ x-ms-office365-filtering-correlation-id: 3c93cb0e-bc8d-4e04-4125-08dc274788c2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SiKBxn+mnZGeLcjcDUoiBzjCdaq2fQaJ4cLcXEVgJVwC9rERJfK8YL1smVeKVaaHF07S7UglVfYi65C1GryIoN+3oRKQ+AubUU4rGkAMgaeJix8InZLIHmrBTgdDkRuCBXy4jzjmp/cj9u2y2Du+yqI8YsX4TORUX29w7meVstlVwCOfMTBIBbM+G9G+z2NOgdhtF+qZgrQHmwjya5ulwjmMqzTJXr3Oaf8xTzSnDxgU+ZRSZyXeNeOcdlNG8/pY3r6AdStHUi0hAXbtJfVYM5ylPcfvY3DiWwUbiFHvjky0Ink8iaIAW0gn7dEc8J7TjyZPhcuffRxHTncnXIT8KYDz/O2aF0Zns+ZD61iJ/cUvkcrV8QODn/TGSMX9M7bvCZuAv0VV36BaNwFz1bKP0rOk6t6DzqFlNpUfB6LDgbu3yQsgfW1KlH6HD9BN+sP5QBAvPO95TmJaGqRAeQMcwU43s6TivTUO1Uq7VBnuJn1wruoLbu8eebuDaS6Elm1vI8FEW9o7mV1Miehi29SCyOOsLU5zgXUkP33jxp8lZD2KSQiYGfMb3rPdNlIaQWSEdBD08DnRe5eYV8qTKvQ64paIo/GGqKnlLjVxaQSRArxP+7WKaCycKRuMWNF+UdXu 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)(366004)(346002)(136003)(396003)(376002)(39860400002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(41300700001)(26005)(86362001)(5660300002)(2906002)(478600001)(110136005)(54906003)(38070700009)(66476007)(44832011)(66446008)(76116006)(66946007)(66556008)(64756008)(52536014)(8676002)(9686003)(8936002)(4326008)(71200400001)(6506007)(7696005)(33656002)(38100700002)(55016003)(122000001)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fuUGVXd1O3nepW5JpO5SmFre7hOj89udCaq7pTuNDa7i9HJ6wA82b/bm7Nry?= =?us-ascii?Q?D4m/+KoeShmBK8ICCBRB8Sdgnam3lAhOwQeu6FPasP4HSmHDR31ZZKe9laW1?= =?us-ascii?Q?C4PoCNjpUINdK5JWe3ODkWihi+RX2k0D8pLPdSrCkKl0R/cagVYazop788wd?= =?us-ascii?Q?2MIictShbdj6ywBQQ+Fh48sv4SLO0Y2F3Cf2PN49k+EyDB/asixFN5cuDlXa?= =?us-ascii?Q?RsOQXAzl54Ae4j8hbKcOZYaVYKuIjxGgmpETx1ozUJjja7ZX85m9m6B/5Kay?= =?us-ascii?Q?ToxAmN4nIfTTnVGaNQY2AwjaqIUrp+Ler7A0mStj9L4HDgARk8lGRHUA9lwv?= =?us-ascii?Q?f2j7+JvHnaE0Qg30UPLIY9O87JAyYl3gNMTNc+F1AFgRDxE6f9ftBzlbhyq8?= =?us-ascii?Q?FLuLVzlVAnDA/H65+rPBqvEcKqPQ2OxXWP6pez+CM/kKMVMRjd80yDXJXp7w?= =?us-ascii?Q?P3LLyd8Qj8gF4+wlNCi7WveOfFR6p/sZKfduw129Dxi6CFPHea19cQRB12+t?= =?us-ascii?Q?ctthPWrqXRwYEN+VN635w+UqlH0aJO5adBLuSFYSxXxXAzF2z+HQ/Q3SCaEd?= =?us-ascii?Q?jBMc7mhd1l4Z4Gitk8HwN9lG3vMEidj++VNQ5/WbKMSgqwJwDle30Ptj4Jzb?= =?us-ascii?Q?L6 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: h8sKK+dsNuAML0DYyE2/LXayULnaRxwi0JroXuCpUiG9iPbnFmzYp1gJo68pIqBNMa21IJieYBy9R0oqmt1MElYKRPOxuwAvbeJvHpNBZ7D9guT2l7p/vFsX0ZdTijov5TTxgS+J7ECUeoQ7LmLvdoIXLBYe75aTCMVQHJR8H7F1Sau+5XwrBDOIw54SaPP+tVayt3v3Y2wcI0F6GMUcrNfkXQABRPLHkaUWfJwZuDQyOzwt+eScMUl23ds1bNwWhrsvGHTYvPpiJkgEVIcKEghiflrYbQ9G0CUNAJ4lornjynz0dvQ7OzC2eAlU/fZOBRNdLn7EDUEmzyu6VttoiBXM2uwQGIwHO3wMm5vR0294Dh/mi0XIDxzKi+D3Fgefvef7jdWizPyfRi2wziSgQrdZfJRB1gOfNGMyHxglfvTaq6ZEBMys75f/1tgyJVbsZP/IZmAMK5ARNiuvd4XO6Yh7K0mAg7PzowBb4cR5DtQIkIxnGTvjy22GsLjYQVwhY0WBsWeNiCcCg1F7N/uiT/eTkhYHJVShqIydsregmTu62U4IjHLcEnCWDgUvJSpazoMCjsFOkBVWuTtHTYLkPpch0HTR8rJqPqOdgpsdjBU= 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: 3c93cb0e-bc8d-4e04-4125-08dc274788c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2024 19:12:17.0267 (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: 3PVwxWKMWIf8LK3q5Qd7TPzWebqrhT/VjOpkyvAXPvMSIBmuxx5ssaWctlLWu5L+jkFdup+8fB574rTEOaVKyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB7723 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_12,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402060132 X-Proofpoint-ORIG-GUID: fa9f39MTYAb2gNSPiRULHZtKdTBdDTup X-Proofpoint-GUID: fa9f39MTYAb2gNSPiRULHZtKdTBdDTup 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:315945 Archived-At: > > Are you suggesting that COND/CASE/... and other "trivial" matching > > constructs should be replaced with PCASE/COND*? >=20 > No, just that using pcase in these cases isn't wrong. >=20 > Drew Adams writes: >=20 > >> Simply because [1] pattern matching is a more > >> powerful generalisation, capable of expressing > >> case-distinction; [2] in the end it compiles > >> down to almost the same code anyway. > > > > Wow. Really _not_ a good reason (IMHO). > > Neither of those reasons [1,2] is good. > > > > With that reasoning you'll use `pcase' > > _always and everywhere_ - never `if', > > `cond', `let', `or', `and',... >=20 > Please don't be dishonest; Huh? Why would you think/claim I'm being dishonest? Care to elaborate? > My question was why cl-case was more > appropriate than pcase, where both are macros that boil down to simpler > primitives. I don't see an inherent advantage to using the more > specific abstraction over the more generic one. I like pcase, and > prefer using it in my code, but if you've got some code that is already > using a lot of cl-lib and no pcase, then there is no point in > transiting cl-case forms into pcase. The inherent advantage is what I & others have pointed out: clearer _intention expression_ for human readers. It says, in effect, "This just tests the value for simple equality (using this or that equality predicate)." It speaks quietly, humbly, clearly. `pcase' advertises instead: "Here come the Big Guns, which can wrestle _anything_ to the ground! Stand in awe and wonder." No one is saying someone can't use `pcase' for whatever they like. It's about style.