From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73853: 31.0.50; and-let* is useless Date: Fri, 18 Oct 2024 19:42:44 -0400 Message-ID: References: <87a5f2xir8.fsf@web.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38452"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73853@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 19 01:43:59 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 1t1wdT-0009qr-90 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Oct 2024 01:43:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1wdC-0000DK-LX; Fri, 18 Oct 2024 19:43: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 1t1wd9-0000Cy-HM for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 19:43:40 -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 1t1wd9-0004HW-47 for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 19:43:39 -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=F8HmKQAdfV+34KA+Eo3XuWtpkD8knC1Ix0EaBhzc/64=; b=Ayyz4eDOsZBY089Khyje8PfQHNnaR3uKcRkInHcjrzwQRZviM844BUnJgKe5kcwEf0lKbCPUHb706dkSS2cDnc9B7d1VrDyR632/XKXn+QWzGA8vU56M8eowy6rZqBtaVEp22au0LlHaxZXu1tkBt19iWonWUpRP5GH+yRa4NKz2qXDqTrd85fiFeq/HOnphA6PRllbBKN29tXVJkggAtpFAptajrjWZs9bo6aOycPN4XrpbCTbq1TtvAjfRVcJM/57ijz+8IF+xRfB/SBp3efBi19W6nwpd3FjqdEvQPIqvRKLjgJGRmZQuI/bjFjW8nPdOIEGBUzTpADO+o0tOvw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t1wdV-00038m-Jm for bug-gnu-emacs@gnu.org; Fri, 18 Oct 2024 19:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Oct 2024 23:44: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.172929500611974 (code B ref 73853); Fri, 18 Oct 2024 23:44:01 +0000 Original-Received: (at 73853) by debbugs.gnu.org; 18 Oct 2024 23:43:26 +0000 Original-Received: from localhost ([127.0.0.1]:40477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1wcw-000372-50 for submit@debbugs.gnu.org; Fri, 18 Oct 2024 19:43:26 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1wct-00036Z-CU for 73853@debbugs.gnu.org; Fri, 18 Oct 2024 19:43:24 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 67033809CE; Fri, 18 Oct 2024 19:42:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729294972; bh=0TkGkIkbiGI+Uc6ZMUWhJS7jQdFS48zsT4sHkfwP84I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eJvrSGHxKso2HiLj6upNAyWMpBJZg9dsgl3VDOUmDftb8BBPDqy7So0LBuLSlBjbQ ypjqPOlDMJ/D4tB22PD7n9lGW7Nvl1TjRZHl8mRc7IQQVoUGtCcRD4Zj87n2q01rHR 6a3E1uKTsrZR94KqWZL/E7ZZmLTuOx9NvzBIRqumapCSF8B0xDV8qeZrc8dgptY422 k3WoswO0ORuStMyuexNfCjnFbP6T6WXjugO9jetvoemN1knHHsEcLHo9lOizhBbbex zy7Ekxpmd4sdFdqbfhxOlpkMeSJJLUnKmQaHnZawYXgiX+lrjAZJ4aj6nGv0+JNsqU euHq3vHAe9auw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F23F380926; Fri, 18 Oct 2024 19:42:51 -0400 (EDT) Original-Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7F974120776; Fri, 18 Oct 2024 19:42:51 -0400 (EDT) In-Reply-To: <87a5f2xir8.fsf@web.de> (Michael Heerdegen's message of "Fri, 18 Oct 2024 04:11:23 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.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:293820 Archived-At: >> Can we kill/deprecate this? > `and-let*'s purpose is to express conditions, `when-let*'s is > conditional evaluation. We have `and-let*' and `when-let*' for the same > reason we have `and' and `when'. See prior discussions. But there isn't the same "historical" support that justifies having both, and the syntax&semantics of `and-let*` is just weird: - Why allow a BODY if the motivation is to mirror the normal `and`? If you want a BODY, use `when-let*`. - What's the use of the final variable binding since (assuming you don't use BODY) that variable is never used: (and-let* ((a (fooa)) (b (foob a)) (i-m-useless (fooc a b)))) - There's a special syntax where the final binding can drop the variable name (because of the previous point), which makes for an odd syntax (and-let* ((a (fooa)) (b (foob a)) ((weird-call a b)))) So the use with BODY is redundant with `when-let*` and the use without BODY is quirky (and still redundant with `when-let*`, of course). >> [ I think we have too many (if|when|and)-let(*) for our own good: we >> should pick some winners and deprecate the other ones. ] > AFAIR the non-star versions exist for backward compatibility only - so I > would rather get rid of these. Parallel existence of these non-star > vs. star versions should be a temporary state, it complicates the matter > for an epsilon gain. 100% agreement. Can we `make-obsolete` the non-star versions? >> I could see a use for something called `and-let(*)` but without a BODY, >> for the purpose of remove a level of parens and indentation: >> >> (and-let* >> (x1 (foo1)) >> (x2 (foo2))) >> >> i.s.o >> >> (and-let* >> ((x1 (foo1)) >> (x2 (foo2)))) > > Ugh! - I could not imagine anything with more potential for confusion as > removing the paren around a list of bindings. FWIW, I agree, I don't like that either. Stefan