all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Philip Kaludercic <philipk@posteo.net>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	63103-done@debbugs.gnu.org
Subject: bug#63103: 30.0.50; nconc compiler optimization breaks user packages
Date: Thu, 27 Apr 2023 14:55:00 +0200	[thread overview]
Message-ID: <a7b1e563-2bf4-80ee-b544-3f7230330edd@daniel-mendler.de> (raw)
In-Reply-To: <E90776F9-3E5E-474A-B642-2F1043EFE1E0@acm.org>



On 4/27/23 14:28, Mattias Engdegård wrote:
> 27 apr. 2023 kl. 12.42 skrev Daniel Mendler <mail@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





  reply	other threads:[~2023-04-27 12:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 22:50 bug#63103: 30.0.50; nconc compiler optimization breaks user packages Maks
2023-04-27  5:34 ` Daniel Mendler
2023-04-27  5:44   ` Philip Kaludercic
2023-04-27  6:37     ` Daniel Mendler
2023-04-27  9:47       ` Mattias Engdegård
2023-04-27 10:42         ` Daniel Mendler
2023-04-27 12:28           ` Mattias Engdegård
2023-04-27 12:55             ` Daniel Mendler [this message]
2023-04-27 13:54           ` Drew Adams
2023-04-27 14:02             ` Daniel Mendler
2023-04-27 13:32 ` Maks

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7b1e563-2bf4-80ee-b544-3f7230330edd@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=63103-done@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.