From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt Newsgroups: gmane.emacs.devel Subject: Re: Better documentation for non-binding clauses of if-let and friends Date: Sun, 10 Nov 2024 13:24:46 +0100 Message-ID: <23d411e4-5bcb-4a24-a0ff-464a7b51b168@vodafonemail.de> References: <861pzkmk5v.fsf@gnu.org> <5998bf4f-c35b-409d-9e76-d31ce037c8df@vodafonemail.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35899"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org, Eli Zaretskii To: "Alfred M. Szmidt" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 10 13:25:51 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 1tA70o-0009Ad-PO for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Nov 2024 13:25:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA70C-0003X7-Ij; Sun, 10 Nov 2024 07:25:12 -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 1tA708-0003Ux-A0 for emacs-devel@gnu.org; Sun, 10 Nov 2024 07:25:09 -0500 Original-Received: from mr6.vodafonemail.de ([145.253.228.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tA705-000511-Rz; Sun, 10 Nov 2024 07:25:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1731241501; bh=fl4Dii6bHQxIqMxZWWAb+0E3+xzh7aZzN6RWAWEMdCE=; h=Message-ID:Date:User-Agent:Subject:To:References:From: Content-Language:In-Reply-To:Content-Type:From; b=q5kTcaZwk5xKuPm+rJIp19oZmyS/K+JfPU28ATIGub94+aE3hubpzJ7yrYaN7kEFG NeXGf1NS2pCgAEkbZMWHAR8GGnGHZ56a8qoTEzzq21PC1JC0XIRK5rhkZZIu/gjkkR xuGDT8ZBZ/fkDZP/QqMQOuU82hPVbv8WD0/7QY1E= Original-Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4XmX1n51GQz1yF7; Sun, 10 Nov 2024 12:25:01 +0000 (UTC) Original-Received: from [192.168.178.41] (port-92-196-56-60.dynamic.as20676.net [92.196.56.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4XmX1b20srz9054; Sun, 10 Nov 2024 12:24:47 +0000 (UTC) Content-Language: de-DE-frami, en-US In-Reply-To: X-purgate-type: clean X-purgate: clean X-purgate-size: 1724 X-purgate-ID: 155817::1731241497-DE7EB477-A1046A31/0/0 Received-SPF: pass client-ip=145.253.228.166; envelope-from=jschmidt4gnu@vodafonemail.de; helo=mr6.vodafonemail.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:325374 Archived-At: This turned out to be a discussion orthogonal to the one on while-let, so I think it deserves its own thread ... On 2024-11-10 12:44, Alfred M. Szmidt wrote: > If this is useful or not is one thing, but clearly these macros try to > be too "smart" and don't follow their own description of what they do > in either docstring or manual. I rather agree with Joost on that other thread regarding the usefulness of the FOO-let macros and their condition-only, non-binding clauses. > There is no mention of this in the manual, that only says that SPEC is > like the one in LET*. But I agree with you that the manual is incomplete or even wrong here. How about the following in section "Conditionals" instead of what there currently is about these: There's a number of variations on this theme, and they're briefly described below. For all of these SPEC is similar to what let* offers, with a few extensions useful in the context of testing conditions: As with let*, an element of SPEC which is a list (SYMBOL VALUEFORM) binds SYMBOL to the value of VALUEFORM. An element can additionally be of the form (VALUEFORM), which is evaluated and checked for nil; i.e. SYMBOL can be omitted if only the test result is of interest. It can also be of the form SYMBOL, then the binding of SYMBOL is checked for nil. -- Macro: if-let spec then-form else-forms... Evaluate each binding in SPEC in turn, stopping if a binding value or value form is ‘nil’. If all are non-‘nil’, return the value of THEN-FORM, otherwise the last form in ELSE-FORMS. -- ... If needed, I can provide that or something similar as a patch ...