From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Code for cond* Date: Thu, 18 Jan 2024 10:44:00 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7010"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 18 16:45:01 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 1rQUZh-0001ch-3W for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Jan 2024 16:45:01 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQUYz-0001FD-CA; Thu, 18 Jan 2024 10:44:17 -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 1rQUYx-0001Cy-B5 for emacs-devel@gnu.org; Thu, 18 Jan 2024 10:44:15 -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 1rQUYx-0006zf-0j for emacs-devel@gnu.org; Thu, 18 Jan 2024 10:44:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=jzwUSVin53zwf11VbY1NgYjTkA6GQ2QnIGoR50NARNM=; b=l6+fz+Z/SULTI4zxBR55 A1cfi8VFUM8d3O3ART36+phcF5zpGmBjWXmXFchL8dvto5gAUo0qw7mzZa6tkcByvV9tjeNEU7Rna kMNhJkrYhI3nTdT0FOuiEEybPxRxPDtKV2lBz4BIWl1u5zcE6OXR6PuEKk/Id1w2msuX8jYkdNF6W YIzf7kBVNu5iafO9zsz028VH5S7+vT1LzMHaSL5kLBc4JEGApqG2AFDXO/ClWhKv3SCWgCSviHG6s s3/fsm+WHaUDPQVnmLqh+4yvll60TNs7AWEbHQJKcLniLxzGH4MCcoh9AH9zlM4tk0oUsLVuFCP05 LSj82We1BYmdow==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rQUYi-0004qW-S8; Thu, 18 Jan 2024 10:44:01 -0500 In-Reply-To: (Richard Stallman's message of "Wed, 17 Jan 2024 22:37:47 -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:315090 Archived-At: Richard Stallman writes: > [[[ 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. ]]] > > Here is the first draft of cond*. I have tested some cases > but I ask others to help in testing it more thoroughly. > > I invite constructive comments, bug reports, patches, > and suggestions. > > First, here is the draft documentation. > > > A cond* clause is a "non-exit" clause if it (1) starts with t, (2) has > only one element, or (3) has a keyword as the first or last element. > After a non-exit clause finishes, control proceeds to the following > clause. > > All other clauses are like cond clauses, in that when the condition is > true, it executes its clause body and then exits the cond*. > > (cond* > ;; Same as a clause in `cond', > (CONDITION > DO-THIS-IF-TRUE-THEN-EXIT...) > > ;; Execute FORM, and ignore its value > ;; (except if this is the last clause). > (FORM) > > ;; Variables to bind, as in let*, around the rest > ;; of the cond*. > ((bind* (x foobar) y z (foo 5) a)) > ;; Bindings continue in effect for the whole cond* construct. Hi Richard, apologies if it was discussed already, wanted to ask: what is the reason for some of these cond* clauses to keep the binding in effect outside the clause itself and for the whole cond* construct? At first glance it doesn't look very idiomatic in Lisp terms to me. Thanks! Andrea