GNU bug report logs - #73853
Should and-let* become a synonym for when-let*?

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Thu, 17 Oct 2024 16:31:02 UTC

Severity: wishlist

Found in version 31.0.50

Full log


Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 73853 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#73853: 31.0.50; and-let* is useless
Date: Fri, 18 Oct 2024 04:11:23 +0200
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> 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.

> [ 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.

> 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.  This would add one more
year-lasting round of discussing these constructs.  If you do this,
please call it `and-let*?@!' so than everybody is warned.


Michael.




This bug report was last modified 140 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.