GNU bug report logs - #40692
28.0.50; Constant list modified inside function

Previous Next

Package: emacs;

Reported by: Ivan Andrus <darthandrus <at> gmail.com>

Date: Fri, 17 Apr 2020 23:46:02 UTC

Severity: normal

Found in version 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ivan Andrus <darthandrus <at> gmail.com>
To: 40692 <at> debbugs.gnu.org
Subject: bug#40692: 28.0.50; Constant list modified inside  function
Date: Fri, 17 Apr 2020 21:05:31 -0600
On Apr 17, 2020, at 5:45 PM, Ivan Andrus <darthandrus <at> gmail.com> wrote:
> 
> I believe this is the root cause of a bug in magit/forge https://github.com/magit/forge/issues/267 in which all subsequent pull requests created have the same name.  The maintainer of magit/forge (tarsius) was unable to reproduce that bug, so I tried my hand at creating a minimal test case, and I was able to get it down to this.
> 
> Now, I understand reference semantics of lists in general, but it seems like this should be different.  If this behavior is intentional, what's the best way to for creation of a new list every time so that functions using the alist don't have to worry about not changing the list?

I tracked down the function doing the actual changing: json-encode-alist.  I filed https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40693   

I still find the behavior here confusing, but I expect it will be considered expected behavior.

-Ivan



This bug report was last modified 3 years and 324 days ago.

Previous Next


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