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: combining cond and let, to replace pcase. Date: Sat, 25 Nov 2023 22:14:20 -0500 Message-ID: References: <87v89t7y13.fsf@neko.mail-host-address-is-not-set> 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="22831"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Tomas Hlavaty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 26 04:15:16 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 1r75c3-0005gF-CQ for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Nov 2023 04:15:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r75bE-0007wf-Q1; Sat, 25 Nov 2023 22:14:24 -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 1r75bD-0007wX-VI for emacs-devel@gnu.org; Sat, 25 Nov 2023 22:14:24 -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 1r75bD-0003Cp-Ld; Sat, 25 Nov 2023 22:14:23 -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=NoEb5/I/4AqKDpTFrh06IGY6mwImtXyaYAOrygN0cHU=; b=NfawhDrSOY/D yeFNqx7m9Hg7qNxeShYMHPFn3gys5T9ku9JlatrEtU01K5xnvh5wQEoa/cZTTh9cL+VtegJ/pLuWC qxBm4HjYR0eZCHyHNbMlyJK81PF8L8+JoyQFBQnoTvxKQrRJr0HKfzJpcrrFjczshCX6iwNWr7pR1 ltEAXlmi9v/2YpgZTsjAtumZ+pLhYXlFaNsR+s/icJe4CecFs6EKKowXjF5fBhv5mwsoTEXV/+cmQ ngM5IKkyV2q8AYn5wWMZ8+CKIYoLYfOAcFGS8OHg/umP377+Ckf0njlN8xjdxg2XKCGFOwCOXHGKw oPkgMJbuEozEajQ/0DwihQ==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1r75bA-00026a-Mc; Sat, 25 Nov 2023 22:14:21 -0500 In-Reply-To: <87v89t7y13.fsf@neko.mail-host-address-is-not-set> (message from Tomas Hlavaty on Thu, 23 Nov 2023 08:02:16 +0100) 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:313229 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. ]]] > > ;; Same as a clause in `cond', > > (CONDITION > > do-this-if-CONDITION-then-exit...) > > > > ;; Variables to bind, as in let > > (:bind (x foobar) y z (foo 5) a) > > ;; Bindings continue in effect. > This seems nicer: > (if CONDITION > do-this-if-CONDITION-then-exit... > (let ((x foobar) y z (foo 5) a) > ...)) That is what you can do now with `if' and `let', but many levels of nexting get to be inconvenient and hard to read. That is one of the practical conveniences of _using_ `pcase'. I think a replacement for `pcase' should offer the same advantage. > It looks like everybody is trying to design a "do it all super-macro" If that refers to the approach of `pcase', in which there are dozens of different features one must learn, then `cond*' represents turning away from that approach. `cond*' has just four features, two of which are modified from `cond'. That's why `cond*' will impose less burden of language complexity than `pcase'. -- 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)