Subject: bug#73853: 31.0.50; and-let* is useless

From: Stefan Monnier <[email-masked]>
Date: Sat, 18 Jan 2025 09:15:33 -0500

> As it's a readability aid, it doesn't have to be used absolutely
> everywhere to be useful.

For if/when/and there are *other* reasons to have those three
(e.g. a 4-way `and` becomes much more indented&ugly when replaced by
ifs/whens), so since we have them and since they overlap in many cases,
it can make sense for people to try and convey the intention of
their code by choosing one over the other when they can be
used interchangeably.
But this extra intention information was never the reason to have all three.

For `and-let` vs `when-let` there is no other reason to have both: every
`and-let*` can be replaced by a `when-let*` with virtually no difference
(and in practice all `and-let*` I ever found could similarly be replaced by
an `if-let*`), other than this act of conveying an intention.

> I think you are letting the perfect be the enemy of the good, in your
> thinking, here.

No, I'm trying to argue that `and-let*` is useful only because it
exists, whereas I think we should limit ourselves to things which exist
because they're useful.

If we had an alias of `let` called, say, `do` that behaved exactly the
same, people would likely be tempted to use it to convey the idea that
it doesn't return a value.  And then if I were to point out it's useless
I'd apparently see the exact same resistance I'm getting now.

        Stefan