GNU bug report logs - #63103
30.0.50; nconc compiler optimization breaks user packages

Previous Next

Package: emacs;

Reported by: Maks <mvproton <at> gmail.com>

Date: Thu, 27 Apr 2023 04:17:04 UTC

Severity: normal

Merged with 63100, 63101

Found in version 30.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Philip Kaludercic <philipk <at> posteo.net>, Stefan Monnier <monnier <at> iro.umontreal.ca>, 63103-done <at> debbugs.gnu.org
Subject: bug#63103: 30.0.50; nconc compiler optimization breaks user packages
Date: Thu, 27 Apr 2023 14:55:00 +0200

On 4/27/23 14:28, Mattias Engdegård wrote:
> 27 apr. 2023 kl. 12.42 skrev Daniel Mendler <mail <at> daniel-mendler.de>:
> 
>> I think it is
>> kind of nice that `nconc' can be used as a tool to turn a proper list
>> into an improper list and vice versa.
> 
> It's a bit obscure, though --

Probably. I am not sure if I came up with this pattern independently. It
is likely that I've seen it in some other packages. So it is good that
this is fixed.

>   (setcdr (last X) nil)
> 
> is a lot clearer than
> 
>   (nconc X nil)
> 
> and when the latter is preferred for performance, a comment might be polite to the reader.

The problem is that `setcdr' of `last' is not correct for the empty
list. The two lines are not equivalent.

> Anyway, a fix has been pushed to master, and the manual entry for `nconc` got an extra example.

Thanks.

Daniel




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

Previous Next


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