GNU bug report logs - #70524
[PATCH] Fix `map-elt` with `setf` for subplaces

Previous Next

Package: emacs;

Reported by: Okamsn <okamsn <at> protonmail.com>

Date: Tue, 23 Apr 2024 02:12:03 UTC

Severity: normal

Tags: patch

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: okamsn <at> protonmail.com
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Stefan Monnier <monnier <at> iro.umontreal.ca>, 70524 <at> debbugs.gnu.org
Subject: bug#70524: [PATCH] Fix `map-elt` with `setf` for subplaces
Date: Thu, 25 Apr 2024 14:49:22 +0200
On Thu, 25 Apr 2024 at 01:59, okamsn <at> protonmail.com wrote:

> I would have assumed that `aref` would work with subplaces. I am still 
> thinking of `setf` like a more flexible version of Python allowing 
> things like `my_list[0][0] = 27`.

The right way to achieve this IMO would be the one indicated in
bug#62068:

  (setq my-list (map-insert-in my-list '(0 0) 27))

(I believe I even had an implementation for it, but never submitted the
patch.)

If there's a reasonable way to make a bunch of nested setf's expand to
this, I don't know.  I guess it should be possible, but I'm also not
sure it would be really convenient.




This bug report was last modified 1 year and 17 days ago.

Previous Next


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