Subject: Re: bug#75845: mapconcat crashes for unreasonable self-modifications

From: Stefan Monnier <[email-masked]>
Date: Sun, 26 Jan 2025 05:55:44 -0500

> Thanks, adding Stefan and Mattias to the discussion, in the hope that
> they could review the patch and comment.

The patch LGTM.

>>  	  if (! CONSP (tail))
>> -	    return i;
>> +	    error ("list modified by mapping function");
>
> I think this error message is not explicit enough: it doesn't tell
> which list was modified by what function.  mapcar and mapconcat are
> many times invoked by code that has little to do with the level which
> could make sense to the user, so we should try to provide as much
> contextual information as possible.  Perhaps something like
>
>   sequence arg to `mapcar' or `mapconcat' modified by its mapping function arg

Since this is in the list-part of the code, I'd prefer "list" rather
than "sequence", since it's both shorter and more precise.   But I'd
capitalize that first word.

>   string arg of mapcar or mapconcat clobbered by its mapping function arg

+1 for "clobbered"

        Stefan