GNU bug report logs - #50927
Considering only entries with unique keys in map.el?

Previous Next

Package: emacs;

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

Date: Fri, 1 Oct 2021 00:56:01 UTC

Severity: normal

Tags: notabug

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: Okamsn <okamsn <at> protonmail.com>, "50927 <at> debbugs.gnu.org" <50927 <at> debbugs.gnu.org>
Subject: bug#50927: [External] : bug#50927: Considering only entries with unique keys in map.el?
Date: Fri, 01 Oct 2021 04:17:12 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> > entry with the same key.  This is a misleading behavior.
>
> Actually, it's a handy behavior.  It's one of the main ideas behind
> alists.  You can just remove or skip the first match of a given key to
> restore or use the next one.

I tend to agree.  And it's easy to avoid duplicate entries - they
are not introduced when using the map.el functions the right way.

OTOH: the map looping or do- tools also useful for inspecting duplicates
- this is useful.  Avoiding duplicates would also mean O(n^2) equality
tests per map - right?

Michael.




This bug report was last modified 3 years and 295 days ago.

Previous Next


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