From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 73853@debbugs.gnu.org, Jim Porter <jporterbugs@gmail.com>,
Stefan Kangas <stefankangas@gmail.com>,
Sean Whitton <spwhitton@spwhitton.name>
Subject: bug#73853: 31.0.50; Should and-let* become a synonym for when-let*?
Date: Mon, 28 Oct 2024 14:58:37 +0100 [thread overview]
Message-ID: <87iktcuy5u.fsf@web.de> (raw)
In-Reply-To: <jwvr081pqid.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 27 Oct 2024 10:41:13 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 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.
I do not see an if-let where condition testing return values are
referenced in THEN, but conditions are independent and exchangeable, as
necessarily unnatural. Even when the implementation:
> [...] to something like:
>
> (when-let* ((t1 (fooa))
> (t2 (foob))
> ...)
> (let ((a t1)
> (b t2)
> ...)
> (bar)))
would not be as straightforward as for `if-let*'.
> So coders who "simplify" `when-let*` to `when-let` when the * version is
> not needed, would in reality just pessimize their code.
The other side is readability, like for `let' vs. `let*'. In my
experience condition not too seldom are independent from each other. I
would be able to make that explicit for the human reader.
But if all of you guys don't like the idea then ...ok, so it be.
> 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*`. 🙂
Your timing of mentioning such things still has an epsilon of room for
improvement.
Michael.
next prev parent reply other threads:[~2024-10-28 13:58 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 16:27 bug#73853: 31.0.50; and-let* is useless Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-17 16:40 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-18 2:11 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-18 23:42 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-19 3:50 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-21 7:07 ` Augusto Stoffel
2024-10-21 8:57 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-21 12:09 ` Sean Whitton
2024-10-19 3:38 ` Sean Whitton
2024-10-20 12:24 ` Stefan Kangas
2024-10-22 14:47 ` bug#73853: 31.0.50; Should and-let* become a synonym for when-let*? Sean Whitton
2024-10-22 15:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-23 14:05 ` Stefan Kangas
2024-10-24 8:51 ` Sean Whitton
2024-10-25 12:09 ` Sean Whitton
2024-10-30 9:42 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-26 19:25 ` Jim Porter
2024-10-27 7:08 ` Stefan Kangas
2024-10-27 9:16 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 10:12 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 11:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 11:32 ` Sean Whitton
2024-10-27 11:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 12:28 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 13:10 ` Sean Whitton
2024-10-27 13:22 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-28 9:39 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 14:41 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-28 13:58 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-10-28 14:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 20:00 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-28 2:15 ` Howard Melman
2024-10-28 3:19 ` Sean Whitton
2024-10-29 15:21 ` Jonas Bernoulli
2024-10-29 16:36 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-30 0:49 ` Sean Whitton
2024-10-30 12:55 ` Corwin Brust
2024-10-30 23:10 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iktcuy5u.fsf@web.de \
--to=bug-gnu-emacs@gnu.org \
--cc=73853@debbugs.gnu.org \
--cc=jporterbugs@gmail.com \
--cc=michael_heerdegen@web.de \
--cc=monnier@iro.umontreal.ca \
--cc=spwhitton@spwhitton.name \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).