From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73853: 31.0.50; Should and-let* become a synonym for when-let*? Date: Sun, 27 Oct 2024 10:16:00 +0100 Message-ID: <87msipkisv.fsf@web.de> References: <87a5f2xir8.fsf@web.de> <87froszrs6.fsf@melete.silentflame.com> <87ed48b3er.fsf_-_@melete.silentflame.com> <87a5ew5few.fsf@web.de> Reply-To: Michael Heerdegen Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12669"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jim Porter , 73853@debbugs.gnu.org, monnier@iro.umontreal.ca, Sean Whitton To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 27 10:16:02 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1t4zNS-00038F-92 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Oct 2024 10:16:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t4zN5-0004Ch-PE; Sun, 27 Oct 2024 05:15:43 -0400 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 1t4zMt-0004BX-Ov for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 05:15:29 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t4zMt-0004IH-At for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 05:15:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Lahp7yyRqVKzk6Bo95J8GE9IkvHeqNAE7ad1mJiIGEk=; b=nI3awRVdOkJHqoWI7A/gKZu1F5fgl5ubrZExPix6A+fHAGtJ7gcZSd9OxrR7HAanZeyWivmxCmyguFzlmRLGp8+AOhf/UvyQ7FZpllSWHEihYpPB5nyIl052fa/E2fULZjy/iec6YQe0niJkrjvIDcPYVKbnsJe5NyJC7NBePM74giPopfqIo6O21fU5hMPxSl+dCvd8H5WtBzKvSF2rQJZzVOPqzRpLzu7EAbAmU/3CnoH3PTXMkqp7bcmageqt0Dw3sbuoh+xxBGr/hqFZ4PpUsX1pGHEjFF/1MdE3bkkN0XVVlLFlR/jT24X2fhy22V54jGy5IUnm60Uk4vmDfQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t4zNR-0002h1-LQ for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 05:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2024 09:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73853 X-GNU-PR-Package: emacs Original-Received: via spool by 73853-submit@debbugs.gnu.org id=B73853.173002055410339 (code B ref 73853); Sun, 27 Oct 2024 09:16:01 +0000 Original-Received: (at 73853) by debbugs.gnu.org; 27 Oct 2024 09:15:54 +0000 Original-Received: from localhost ([127.0.0.1]:43772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4zNK-0002gf-BD for submit@debbugs.gnu.org; Sun, 27 Oct 2024 05:15:54 -0400 Original-Received: from mout.web.de ([212.227.15.3]:56407) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4zNG-0002ei-Pe for 73853@debbugs.gnu.org; Sun, 27 Oct 2024 05:15:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1730020503; x=1730625303; i=michael_heerdegen@web.de; bh=Lahp7yyRqVKzk6Bo95J8GE9IkvHeqNAE7ad1mJiIGEk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=SmC2oU12/MoRB0w7LIdwuRMsXxyD/3Wy7yAB1YjUf0BJncT2RifsGz12gSi+DmRP SltuCXxXpIdda37WhAKHL+Jo/1eCfQiM2j/QG9FPad7tqrn/qB30QxsbOvGGPzX6R cBs9rqTAFzlpqn/ifcxCnVPSLo+R3uBSs6gw0zE7M3QkBptQOJuNxh3DrfmjfXJ2W xRkKiVBscQvjSw7hbpf5qK1WZtyJ8yP+UPqWAh0Gxt/HvrwyhRjQM+lK1SfY3jnK4 h2r1zneoSQfJddLVnzKi/sQBNwZhWnsXkqeDZ5sNO5GqEfJUP8i5/ZkixPyz2ElwQ bh9ORLb2j569Xn4hUw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.75.138.198]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MxYbN-1tph3n3vCb-010MFe; Sun, 27 Oct 2024 10:15:03 +0100 In-Reply-To: (Stefan Kangas's message of "Sun, 27 Oct 2024 00:08:20 -0700") X-Provags-ID: V03:K1:uyR7+137wSwMKQkCcmfStU0lLLI1E5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org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294311 Archived-At: Stefan Kangas writes: > Jim Porter writes: > > > On the other hand, the way bindings work in 'if-let*' and 'when-let*' > > are closer to 'let*' than 'let'. I think that's a false friend though, > > since they're only similar, not actually the same (of course the > > semantics couldn't be exactly the same or there'd be no reason for > > 'if-let*' and 'when-let*' to exist). > > FWIW, this is the argument that convinced me that the `*`-versions are > better: bindings are more like in `let` than in `let*`. To my mind, > that makes the `*`-naming more self-documenting and clear. In the meantime I found out that I am not as decided as I thought: I am actually using both versions in my own code. Valid arguments for either name exist - and it even depends on the case: In this case I prefer the name without star: #+begin_src emacs-lisp (if-let ((a (does-an-a-exist?-then-return-it))) (use a) (do-something-else)) #+end_src Here I prefer the name with star: #+begin_src emacs-lisp (and-let* ((a (an-a-exists)) (b (b-depending-on-a-also-exists))) (test-using a b)) #+end_src Thinking the first example further we could introduce parallel versions and name them `if-let', `when-let' and `and-let'. They would be really analogue to `let' with respect to binding list semantics - compared to the non-parallel counterparts `if-let*' that are what we have now. ATM this idea looks appealing to me as a final goal. Michael.