GNU bug report logs - #37943
assoc-default is wrongly flagged as side-effect-free.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 27 Oct 2019 12:26:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


Message #11 received at 37943 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Alan Mackenzie <acm <at> muc.de>, 37943 <at> debbugs.gnu.org
Subject: Re: bug#37943: assoc-default is wrongly flagged as side-effect-free.
Date: Tue, 25 Aug 2020 16:32:45 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Alan Mackenzie <acm <at> muc.de> writes:
>
>> In the source for assoc-default (in subr.el) appears
>>
>>     (declare (side-effect-free t))
>>
>> .  This is not true when the TEST argument to assoc-default itself
>> changes the match-data.
>>
>> I suggest removing this declaration from the function rather than
>> amending the code with a save-match-data.  There are calls to
>> assoc-default in set-auto-mode where the caller relies on the match data
>> set by the function when TEST is string-match.  :-(
>
> Yeah, I don't think any function that takes a closure as an argument
> should be marked side-effect free?  The TEST function can side-effect as
> much as it wants.

No further replies within 43 weeks.

Should we just go ahead and remove it then?  No one seems to be
objecting.




This bug report was last modified 4 years and 329 days ago.

Previous Next


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