[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#26624: 26.0.50; Generalized variable `buffer-local-value' does't res
From: |
Michael Heerdegen |
Subject: |
bug#26624: 26.0.50; Generalized variable `buffer-local-value' does't restore local flag |
Date: |
Sun, 04 Feb 2018 22:02:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Philipp Stephani <p.stephani2@gmail.com> writes:
> #+begin_src emacs-lisp
> (setq my-alist '((x . 1)))
> (ignore (cl-letf (((alist-get 'y my-alist) 17)) my-alist))
> my-alist
> ==> ((y) (x . 1))
> #+end_src
> I think we should spend significant efforts to avoid surprises. In
> this case, if it means we should remove `alist-get' as well from the
> forms supported by `cl-letf', then I think that's what we should
> do. The documentation for `cl-letf' clearly states: "On exit, either
> normally or because of a ‘throw’ or error, the PLACEs are set back to
> their original values." If it can't do that for some place form, it
> shouldn't be allowed.
But
(alist-get value my-alist)
doesn't change for any value (especially for y), so the alist, or the
`alist-get' place expressions, aren't effectively changed. The object
that represents the alist changes, however. Is that a problem or an
internal implementation detail?
Michael.