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: cond* Date: Sat, 23 Dec 2023 22:57:53 -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="7034"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?Jo=C3=A3o_T=C3=A1vora?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 24 04:58:05 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 1rHFcr-0001cJ-3q for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Dec 2023 04:58:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHFch-0003pt-St; Sat, 23 Dec 2023 22:57:55 -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 1rHFch-0003mg-1l for emacs-devel@gnu.org; Sat, 23 Dec 2023 22:57:55 -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 1rHFcg-0004mh-PO; Sat, 23 Dec 2023 22:57:54 -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=AShBp31y2Qavc0ixZn988qnzDNvhyKLFZX1lrwuKqCQ=; b=Tet5iJbVum8z h00T0Go5yfaDb2pzW1O/PpqQQiIg/ljf61D/P3WzjYSEHsEsqEQ9a1MgwDBVTw+7OIGc4p4jYdxZ2 nDk7+sV0/+w0inAsJjAtIC/VrnvyxYVPg5X+eUFzfpDNEv9SgNVcjOykvzABg1ywNri4yKnn41Yyv HAqGXQLA0kDMJAW2MuBY3PyWtfDFAuDoEt/DV8PpMRmQ0wejVDKpDU1ZyYJlqM6t6vvbcHM7ve7Ky 4Vo5N2jg0GdS3DpkRgdofaOXhkbsWqYv+Q4DKoNID3JnAoeKdLA+4XXo+Jpa//aOdQGngVBKYqNOR Tltbgch5B1ZAqnSRI2zq8A==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rHFcf-0001y9-IK; Sat, 23 Dec 2023 22:57:53 -0500 In-Reply-To: (message from =?iso-8859-1?Q?Jo=C3=A3o_T=C3=A1vora?= on Thu, 21 Dec 2023 09:50:59 +0000) 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:314112 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. ]]] > > Are you talking about this? > > > > (cond* > > ((match* `(expt ,foo ,bar) x)) > > (t > > (something-that-depends-on FOO BAR) ; is this how to use it? > > ) > Yes. It is very simple. In Elisp or any Lisp I know, forms that > introduce bindings are also the containers of any forms that use > such bindings, most notable case being (let VARLIST BODY...) The that introduces these bindings is let, and it also contains them. Likewise for cond*. match* and bind* are not independent constructs -- they are defined as part of cond*. They are used within a cond* to specify the bindings for it. It is a little more complex than the way let* makes bindings but not very different. This is a generalization of a feature of pcase. A pcase clause's pattern may specify bindings that are not contained within that pattern. They are contained within the pcase form. The same is true for cond*, but since it has different kinds of clauses, match* and bind* identify clauses whose first element can make bindings. These bindings are specified by part of the cond* form and contained within the cond* form. (Formerly I proposed the keywords :match and :bind to mark this, but it's equivalent except for syntax.) -- 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)