bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces


From: Stefan Monnier
Subject: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces
Date: Sun, 28 Apr 2024 21:54:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

> I have found cases in Loopy where I am using `(setf (map-elt (map-elt 
> ...))` and similar.  From what you and others have said, it sounds like 
> this luckily happened to work but should not have been relied upon.

No: `map-elt` is supposed to return a pre-existing object from the map,
so the side-effecting on it should work just fine, without needing any
luck (assuming side-effecting the map can be done, of course).

The problem is when you do (setf (map-elt (SOMETHING) ..) ..) and
(SOMETHING) is an operation which (builds and) returns a fresh new
value, such as `cl-subseq`.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]