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

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

bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt


From: Michael Heerdegen
Subject: bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt
Date: Wed, 22 Mar 2017 12:55:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> If MAP isn't a symbol, then map-delete could avoid doing the setf,
> couldn't it?
>
> I think that should make for a pretty useful form.  You can both say
>
> ...
> (map-delete foo 'bar)
> ...
>
> and
>
> (setq foo (cons (map-delete (get-a-list) 'bar) 'zot))
>
> and not be surprised at the results.  It's certainly more fun than the
>current (setq foo (delete 'bar foo)) we have all over the place, even
>if it's something of a departure from how functions like this has
>traditionally worked in various Lisps.

So your suggestion is, with other words, that

(1)  (map-delete EXPR 'bar)

is implicitly transformed into

(2)  (cl-callf map-delete EXPR 'bar)

when EXPR is a valid place expression.

That's a relatively small gain, and some people might prefer the
explicit form (2) for readability.

OTOH, without such magic, we can avoid making `map-delete' a macro.
Personally I prefer this simpler approach.


Regards,

Michael.





reply via email to

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