From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: cond* vs pcase Date: Wed, 07 Feb 2024 19:36:56 +0100 Message-ID: References: <87il32iwmm.fsf@posteo.net> <87o7cttu4l.fsf@posteo.net> <87o7cts9nc.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6124"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: yuri.v.khan@gmail.com, philipk@posteo.net, emacs-devel@gnu.org To: "Alfred M. Szmidt" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 08 06:40:26 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 1rXx96-0001K2-O0 for ged-emacs-devel@m.gmane-mx.org; Thu, 08 Feb 2024 06:40:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXx8i-0007wj-8X; Thu, 08 Feb 2024 00:40:00 -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 1rXmnH-0000PA-Ee for emacs-devel@gnu.org; Wed, 07 Feb 2024 13:37:11 -0500 Original-Received: from mail-vi1eur04olkn2040.outbound.protection.outlook.com ([40.92.75.40] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXmnF-0002nO-7N; Wed, 07 Feb 2024 13:37:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3qqIvgDsU/dmSXGqeOk1Lh35sZWTXNWfy3yjl2QiW95upnbIX7h+oVHsQ+hnBHkkkq57+Rv9h5czQxgxlL0mYgiaJd3wQWqA05StSUhnvlI8t7+nmKKc9zcE8MoP1IlfUrJs46RETV80pLdGFLexQilhesF/50r/BWlJdGCf8fZDTd3TMseIkcVrXzadfA8Qcbt9evCWjBRkxse/E43duzb6me8lqKrl7VIZkho1mX29f7I7IlLL6r3j6Cxc5BmZyQ3WTnu1DrMObM5orQCVJuw38b305PCDW2xJIQEabT/Dp7S5pOBFwB3sjuIzoLmxHRpxRmKEoT6ESo+mY8ldw== 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=fDd2rdAhzePbLwLAYsrX+COO6laHu5gOIzo5Ku+57KU=; b=MuZSNQienuj4FKpOF0+1oKjtjfMCf1TX2/Ye2HL1oiqFfVY9a1iECgH0kGIsNEx2+g3DC9BxqTo6SOGsGaVl3UtbVhyjzS0zR2FDZqX3S6kxMi3dgoKoAgu6RzzVNPwcoR+L4eRnP5cGtDtlSXeHYQBiHCbDzmReV3fxlp3zbkxCmIssgDL+/q6W7L+U5KNe/TTck/UqSy+3QiJGhNWqk0gMBv0tt6lAelttjxnNUOQ/RUBT13zUw7tdYGi4kmSRDUFWIAojQEl9d/9pA+ESuKrsvRDY8HKNAkdD9CZIBPJedvQsVbQZfyKqI9fRYXFq8fz7p13XOySMXEOinEyG8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fDd2rdAhzePbLwLAYsrX+COO6laHu5gOIzo5Ku+57KU=; b=AaepEemsbQN8VG3xDSywIMkGzBPpfgQbnMenTTrLJ2UxSe/oBn2mio46vmr/PVwkjKC+cFJzRV/xUEl6ozvUEAU1UwHobJiahxMUJKH/1qMJyFzfdS2tFJdEuPkD9LwBbMCQxkK3jiFy87TEZoK+pNFXH+1ZttsQhZCxFM3lanjvO07zFRKGRONVQQZDEJpE9ZzbKuWPVCKtFa2CGsSDGehQj5DKAV6oc7I0jOl1Zso7PfCzC918o1HJKShguy+Cc2AZGhCpHEHAmR6J1Yg2hqa8OQnttYNsjyU7sRdx8UtF8pd/sNZQ4kLLsf0w4r8mElhkib091YLXjE785YgYOg== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by PAVPR02MB9524.eurprd02.prod.outlook.com (2603:10a6:102:302::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Wed, 7 Feb 2024 18:37:05 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b91:5e3:fb4a:3b2c]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b91:5e3:fb4a:3b2c%3]) with mapi id 15.20.7249.035; Wed, 7 Feb 2024 18:37:05 +0000 In-Reply-To: (Alfred M. Szmidt's message of "Wed, 07 Feb 2024 12:41:52 -0500") X-TMN: [G0+YjPivjys6sdmtnOANTxBZUXiaBu/8] X-ClientProxiedBy: OL1P279CA0034.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:13::21) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <86il30dstz.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|PAVPR02MB9524:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a607407-87ce-436b-cf6e-08dc280bc830 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CinzQ/+AkGlXHkv85LTKAkKjvwz0ciLIpB7IX5bH6umzwRMSBKc8a+3GaKo8u3Ph0rPeYzZah5LGgIT2Nr2bK3Cuk71F8mgiIJR14TZXY206AULgPk5S9umWwZ/rRbUNXgOMK0nskowj4e+kjHE88ypxbgq2uQHAaeZA4ldmY1E1bOvez3KZumWnrVIK77oizqOSmRwbPB0Agd6t3QyPPurdRQINtZuVNxRnuMvbfn2gWmDxjR1/8/XImGo9ljOVdABUDvPsNSZcYSWhlCaEo83N6FjYtiHcMw7vfFH6krYQ03KX1a109Fhv10qDJNpd9e6eu73VFkEhHEk/qlVZdpCyP0rx6fe6PMp6cCFEhfbB1Ht0aDfjZlCpJXphJewF2u9eRb5qa7TyhqfRG/SebKCKbM2acjvKZVnO+13GW6ZchNfVgisXg6eJeJ/VtHjp2UT5MniFeWzMrMaXfqNLAgoQc21eikIEtIq4LwHB19gYKisD0jJY1aVk2bKerrUcmWVDvCss0f5c/t0kxNDwpSp+JReMZE2MUw/S4BgLPMSCDQ9mGxn/M6bLqjIAYBvf X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XLCe8NjOFN7T6FdZhTUrjL8NWgkXboyBFgc/WWFIsRd7/42LwWv6/mMjgeDo?= =?us-ascii?Q?3szbPVeycwNjSvv1v4HuMmhz3Ez+Awvy8DajwmQfEXVk3/ghqzyPj3R6G8ea?= =?us-ascii?Q?oP632T2EUG/62AMeIHx7sgsbwd1S72o0qXm+g/cDltUtyQ/5OWuDUzzPodMS?= =?us-ascii?Q?nXQW4PZ0VPIcrBgzTiBvFjgWDBcX/0rb4OInX6Fs8bTu50o1T2yBiysAtaaw?= =?us-ascii?Q?LnBn8fTIvC3j6Eq4Yone5Rxul9PnGWl3ygsj9q8cnTiGUUZbzz7g9y9MOUyh?= =?us-ascii?Q?rltpcgfAtTeVDfebU0oyHWC/ZzfOxkYaOa6Ok6V+Lv2VzkTcriIrG1hQUeli?= =?us-ascii?Q?g75kyi8ur08nlzuyVh7t7pwhaaCK02SxWK8oHsXQG/nTxupblrMoKdtBkCnY?= =?us-ascii?Q?/vbOInqkAyuPivpMCRNHufokrSHGtWeJ6MUR2+bMnp/6LIPGu2vlPtl7irOr?= =?us-ascii?Q?NMFHzn35DIRMf3GbKNipmVBeoTb2Yzc/vPy37fNJjRGHDsTbdMlN/1tzKo1J?= =?us-ascii?Q?yocv4hVAkGBx72+hb3O7jiMICb+8Lo8CssLrAhtv/WooJoU9lp2Maw1OUg0s?= =?us-ascii?Q?ztqI64a1mD3M6nAweIYUmur+qA9RXqe0ET40daOkgxTkAS+tbHphuGc7DqDf?= =?us-ascii?Q?DK X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 9a607407-87ce-436b-cf6e-08dc280bc830 X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 18:37:05.3035 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR02MB9524 Received-SPF: pass client-ip=40.92.75.40; envelope-from=arthur.miller@live.com; helo=EUR04-VI1-obe.outbound.protection.outlook.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 08 Feb 2024 00:39:53 -0500 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:316015 Archived-At: "Alfred M. Szmidt" writes: > I am not sure if Alfred meant that in his first message, perhaps he did, but > Drew seems to be more in line with that thinking. At least I understand him so. > > I'm not alluding to any specific design principle, the core issue at > hand is communicating with the person reading the code. Yes, that is how I understand you; but I'll answer same as to Drew; I don't agree that this is the best way of expressing the intention. Both pcase and cl-case in this particular simple context I have posted, express the intention equally well. It is rather that you are aware of the details of cl-case and pcase and understand that the pcase is more powerful and can express more powerful constructs. However just that fact that it is more powerful, does not mandate use of "simpler" construct. As Adam illustrated, in this particular scenario, cond, cl-case and pcase expressed equally well the intention. The runtime cost is about the same too; so I don't think the implementation deatails should guide the decision. That seems to me like some sort of premature optimization, peep-hole optimization of intentions. I am not sure how to express myself here :). > The reason why we have ASSOC, ASSQ, ... are because they make it I am not sure if the reason is the clarity. I think we have, with all right, gone away from abbrevs and accronys such as "assq" or "memql" in function and variable names to more self-documenting code. Those functions are historical artefacts in my eyes. > _clear_, _easy_ to understand code and to _use_. A generic version is > not as easy to understand, or use. Which is also a reason why > keywords are generally eskewed in Emacs Lisp. Is this not clear and understandable: (member elt list #'eql) (memeber elt list :test 'eql) Can we be more explicit in communication the intention which test funciton to use, if communicating exactly that intention is really important. Approoos nameing and historical artefacts, I read once an interview with Ken Thompson; I don't remember on which site, so I don't have the link, but they were asking him a bit about Unix design and a bit about C language amongst other things. On the question if he regret anything abotu Unix design, he said, if he regret he used "creat" instead of "create" as the name for the syscall. Best regards /arthur