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: Lars Ingebrigtsen
Subject: bug#25929: 25.2; map-delete doesn't delete permanently 1st alist elt
Date: Wed, 22 Mar 2017 13:01:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Michael Heerdegen <address@hidden> writes:

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

If we don't do this, (map-delete foo 'bar) has surprising effects in
this one corner case.

That is, if foo is a hash table, then it's fine to say
(map-delete foo 'bar).  If you change foo to be an alist, you then have
to transform all the calls to be (setq foo (map-delete foo 'bar))
instead, which kind of breaks the abstraction that map-delete tried to
offer, I think?

Making map-delete signal an error in the
alist-where-bar-is-the-first-element sounds even worse to me, since the
user may already be writing this stuff as (setq foo (map-delete foo
'bar)).

(I think this was what Stefan suggested...)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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