GNU bug report logs - #60758
29.0.60; while-let uses if-let* convention in contradiction to the docstring

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Thu, 12 Jan 2023 19:23:01 UTC

Severity: normal

Found in version 29.0.60

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: Sean Whitton <spwhitton <at> spwhitton.name>, 60758 <at> debbugs.gnu.org, 60758-done <at> debbugs.gnu.org
Subject: bug#60758: 29.0.60; while-let uses if-let* convention in contradiction to the docstring
Date: Sat, 14 Jan 2023 17:11:34 +0100
Daniel Mendler <mail <at> daniel-mendler.de> writes:

> But then it may make sense to deprecate `if-let` and `when-let`
> altogether in favor of `if-let*` and `when-let*`?

I don't recall why that hasn't been done.  There was a very long
discussion about it.  Probably the answer was "the syntax had been there
for too long and now too many packages use it and we don't want to break
them", I don't recall.  Maybe you can find these discussions.  There had
not been an agreement at least.

> I don't think there is anything wrong with the syntax "anomaly". I use
> the syntax with only a single binding happily in many of my packages.

The problem is the ambiguity that these syntax variations:

| An element can additionally be of the form (VALUEFORM), which is
| evaluated and checked for nil; i.e. SYMBOL can be omitted if only the
| test result is of interest.  It can also be of the form SYMBOL, then the
| binding of SYMBOL is checked for nil.

create.  These interpretations had been added later, but they collide
with the special handling of the (SYMBOL SOMETHING) syntax that the
original `if-let' supported.

Michael.




This bug report was last modified 2 years and 128 days ago.

Previous Next


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