Subject: Re: bug#76017: 31.0.50; Which args can cl-nintersection and cl-nset-difference mutate?

From: Pip Cet <[email-masked]>
Date: Fri, 14 Feb 2025 11:13:24 +0000

Mattias Engdegård <[email-masked]> writes:

> 13 feb. 2025 kl. 19.13 skrev Basil L. Contovounesios <[email-masked]>:
>
>> I propose the attached.
>
> Thank you, this should be fine. I was clearly over-cautious in
> labelling the second arguments to those functions as destructive in
> mutates-arguments, and agree that there is no significant advantage to
> preserving the right to mutate it (which we never really had in the
> first place).

It seems to me the only possible advantage in the cl-nset-difference
case is you could sort (and possibly uniq) both lists in place and
traverse the sorted lists.  But that would require many changes to the
current Emacs code, and I don't think it's going to happen.  Similarly,
the "mutate the shorter list" thing for cl-intersection seems unlikely.

Maybe if feature/igc is merged, and becomes a common option, we can
formally make cl-nintersection an alias of cl-intersection, rather than
the currenet somewhat redundant wrapper.

As a followup, I would like to propose removing claims of cons cells
being reused "whenever possible", though: we reserve the right to
mutate one of the arguments, but we don't, so we shouldn't make such
claims.  (And what's "whenever possible" supposed to mean, anyway?  All
cons cells are equal!)

Pip