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; Should and-let* become a synonym for when-let*? Date: Sun, 27 Oct 2024 10:41:13 -0400 Message-ID: References: <87a5f2xir8.fsf@web.de> <87froszrs6.fsf@melete.silentflame.com> <87ed48b3er.fsf_-_@melete.silentflame.com> <87a5ew5few.fsf@web.de> <87msipkisv.fsf@web.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23933"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73853@debbugs.gnu.org, Jim Porter , Stefan Kangas , Sean Whitton To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 27 15:42:56 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 1t54Tm-00063R-PT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Oct 2024 15:42:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t54TV-0007aF-73; Sun, 27 Oct 2024 10:42:37 -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 1t54TL-0007Zt-Iu for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 10:42: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 1t54TL-0005uL-Ax for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 10:42: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=AoteSCzJIP3X0N2j3+X/Dstwqc34Ck+H0qJZZBFXpX4=; b=ixG/MLWagnDzIhEiw24puvUAjhr6ZmFHxfQf4isfi95dkaMUiDilD4m6yQ8Z0TzV55SZZ+B/kBKNRsz5ljB9NxpdCM9VlQnGzffoEP4EetikS23d+O9hZr1RWKa0vMR9xaNa1bWiQ3wvhx64JvsozGJq0PD8F5JLsRWyA8IdD6o/ouiqOZRaIoc789ww2E5Z6ywbz0fIYJl3z2lOuAiKHseSohYWBk16P/BgWKXy4Ye46DSVaZncH9hi45wj2jWI0iBI31Aqc6JEPQntlAYgM0tD+EtkwFFEDI4Rshqmo/yiGRDSSabFelot/o17KbSJ5d5FoDqcPnH2eVcLATYrzA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t54Tt-0001oa-W0 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2024 10:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2024 14:43: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.17300401226899 (code B ref 73853); Sun, 27 Oct 2024 14:43:01 +0000 Original-Received: (at 73853) by debbugs.gnu.org; 27 Oct 2024 14:42:02 +0000 Original-Received: from localhost ([127.0.0.1]:45900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t54Sv-0001nA-Fp for submit@debbugs.gnu.org; Sun, 27 Oct 2024 10:42:01 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t54Sq-0001ms-Sc for 73853@debbugs.gnu.org; Sun, 27 Oct 2024 10:41:58 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2DF654406EF; Sun, 27 Oct 2024 10:41:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730040075; bh=Fg69gBUfcCavqe+aGqZn8StDeYajsah/IIoudpk1JoI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kDuqnReGHZnlQq0Kpt6Gh1NqNzE7jHv8wNTzR+o3YNXQG8tYLHamZSF2U0c5LqBP+ HHg8GsG4mNo+7tRcMYfV2qQBI84T1wD8RWXeL2nw1xu5a7u17BuTXUqRUXGPKTgc2Q AzI5S/YW6RUgxeYSwc3DnFNZogIK5nLCUJDTFckS77PI3GT9YXBplOQOD61+lTPdIx WUg9ftv3gqd3kfKGU5uUA5MsJ7v/PZrkc1gKlHnf7KrlsJHCev+FY3mmQXszLPsqa6 hoL/mwSepLehx4wYuaZqA6lX07AR9JyF3F+T9phJH7umXb2caiohCpgLMSL0L306U0 R96bPtNlrcRkA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 161414406D2; Sun, 27 Oct 2024 10:41:15 -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 CC7AA120470; Sun, 27 Oct 2024 10:41:14 -0400 (EDT) In-Reply-To: <87msipkisv.fsf@web.de> (Michael Heerdegen's message of "Sun, 27 Oct 2024 10:16:00 +0100") 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:294365 Archived-At: > 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. The only natural semantics for something like when-let is the "sequential" bindings of `let*`. The `let` and `letrec` semantics are "unnatural" here, so we should have only the `let*` semantics. The implementation of a `when-let` that has a binding semantics like that of `let` rather than `let*` would have to macroexpand (when-let ((a (fooa)) (b (foob)) ...) (bar)) to something like: (when-let* ((t1 (fooa)) (t2 (foob)) ...) (let ((a t1) (b t2) ...) (bar))) So coders who "simplify" `when-let*` to `when-let` when the * version is not needed, would in reality just pessimize their code. I'll let you guess where I stand w.r.t to naming of `when-let` vs `when-let*`, based on the fact that I originally implemented `dlet` with the semantics of `let*`. =F0=9F=99=82 Stefan