From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
Philipp Stephani <p.stephani2@gmail.com> writes:
>=C2=A0 #+begin_src emacs-lisp
>=C2=A0 (setq my-alist '((x . 1)))
>=C2=A0 (ignore (cl-letf (((alist-get 'y my-alist) 17)) my-alist)) >=C2=A0 my-alist
>=C2=A0 =3D=3D> ((y) (x . 1))
>=C2=A0 #+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 t= he
> forms supported by `cl-letf', then I think that's what we shou= ld
> do. The documentation for `cl-letf' clearly states: "On exit,= either
> normally or because of a =E2=80=98throw=E2=80=99 or error, the PLACEs = are set back to
> their original values." If it can't do that for some place fo= rm, it
> shouldn't be allowed.
But
=C2=A0 (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.=C2=A0 Th= e object
that represents the alist changes, however.=C2=A0 Is that a problem or an internal implementation detail?