GNU bug report logs - #50928
remove-dups

Previous Next

Package: emacs;

Reported by: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Date: Fri, 1 Oct 2021 03:25:01 UTC

Severity: wishlist

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: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: larsi <at> gnus.org
Cc: thievol <at> posteo.net, tkk <at> misasa.okayama-u.ac.jp, 50928 <at> debbugs.gnu.org, drew.adams <at> oracle.com, dgutov <at> yandex.ru
Subject: bug#50928: remove-dups
Date: Mon, 04 Oct 2021 08:42:14 +0900 (JST)
> Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> writes:
> 
>> I wanted to delete duplicated items from a list non-destructively.
>> It took me a while to find out how to do so.
>>
>> (cl-remove-duplicates list :test 'equal)
>> (delete-dups (copy-sequence list))
>>
>> I think it is handy to have something like below in subr.el.
>> Too obvious?
>>
>> (defun remove-dups (list)
>>   "Remove 'equal' duplicates from LIST non-destructively.
>> Note that `delete-dups' deletes duplicates destructively."
>>   (delete-dups (copy-sequence list)))
> 
> This is basically seq-uniq:

Thank you to let me know.  Now I can find its existence in (info
"(elisp) Sequence Functions").  I wonder how I could have reached to
the function by myself.

How did you find it? (apropos-documentation "duplicate")?




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

Previous Next


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