From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Fri, 15 Dec 2023 23:23:57 -0500 Message-ID: References: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2358"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 16 05:24:22 2023 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 1rEMDt-0000I2-Fj for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Dec 2023 05:24:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEMDY-0001YY-EP; Fri, 15 Dec 2023 23:24: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 1rEMDW-0001Sk-7x for emacs-devel@gnu.org; Fri, 15 Dec 2023 23:23:58 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEMDV-0001Hh-VV; Fri, 15 Dec 2023 23:23:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=H08ruXeFST2vNdmSWW5VsVTBet0CWWOPnuSU/Knc23Y=; b=KnC/+9zybu/b VrKOCT6ByYM48KspbE8l7E8N8CL43XAnwbTK+Emz9eMWWjZ+rWDn3m2aSXkZFiCwd3S9Lssm2yOuH SprRyguJTr8SgipXH2+2J3q872zR9eKmzjXjBYk5oSxWnGhxl4cW8rLPkO7KhM5/Iv9XeoGFpJcyu iyemKqdqbWwQM/ZyLrwkLXckupcUP/RvjCiNmPtqU5oYmE0s/7P3aGZlxz/EdJZRdeLcyze5MlCSZ I/NayPifWPrzoFwE8Sj2Er6eog46k3WMNHsBF74qsqEuv3cAVZ/vpJ0zfM4bxyPOtzFvrYaSX/9nw +H5rfvq5h0B1qkya13jE4Q==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rEMDV-00036N-FS; Fri, 15 Dec 2023 23:23:57 -0500 In-Reply-To: (message from Adam Porter on Tue, 12 Dec 2023 19:32:09 -0600) 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:313863 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] My aim in cond* is to include the convenient aspects of pcase without its rigidity of framework, which requires the programmer to squeeze things into it that don't easily fit. That rigidity is the fact that if you want to put one clause into a pcase which can't be written in pcase language, you have to redesign that whole pcase. I suspect that that rigidity creates pressure to extend pcase language to be universal -- so that there can't ever be one clause that you "can't express in pcase language." cond* avoids that problem completely. It lets you use pcase-like patterns where they are convenient, interspersed with Lisp code where that is convenient. The cond* pattern specification is a little more complex than it was in the first version, but it is still far simpler than the pcase language. As far as I know, it needs no further extension. I looked at the pcase examples that were suggested, and they don't need any further extension. The `cdr' and `cdr-safe' feature is not strictly necessary, but the lack of this feature in pcase leads to filling up many patterns with lots of `_' subpatterns. I think this feature is an improvement, but omitting it would only reintroduce the added complexity of those `_' subpatterns. Can anyone show me more pcase examples I should study, which you think show cases that call for adding any more pattern features to cond*? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)