From: Drew Adams <drew.adams@oracle.com>
To: Dmitry Gutov <dgutov@yandex.ru>,
Lars Ingebrigtsen <larsi@gnus.org>,
Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
Cc: "50928@debbugs.gnu.org" <50928@debbugs.gnu.org>
Subject: bug#50928: [External] : bug#50928: remove-dups
Date: Fri, 1 Oct 2021 17:02:08 +0000 [thread overview]
Message-ID: <CO6PR10MB54731E00BD7A9D4D3194E4E0F3AB9@CO6PR10MB5473.namprd10.prod.outlook.com> (raw)
In-Reply-To: <3d76c99d-8727-4eb7-27e5-94d9dc2e9156@yandex.ru>
FWIW, I use this. I don't recall whether I borrowed
it from somewhere or just wrote it from scratch.
(defun my-remove-dups (sequence &optional test)
"Copy of SEQUENCE with duplicate elements removed.
Optional arg TEST is the test function. If nil, test with `equal'.
See `make-hash-table' for possible values of TEST."
(setq test (or test #'equal))
(let ((htable (make-hash-table :test test)))
(loop
for elt in sequence
unless (gethash elt htable)
do (puthash elt elt htable)
finally return (loop for i being the hash-values in htable collect i))))
next prev parent reply other threads:[~2021-10-01 17:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 3:23 bug#50928: remove-dups Tak Kunihiro
2021-10-01 12:45 ` Lars Ingebrigtsen
2021-10-01 13:16 ` Dmitry Gutov
2021-10-01 17:02 ` Drew Adams [this message]
2021-10-01 17:31 ` bug#50928: [External] : " Thierry Volpiatto
2021-10-03 23:42 ` Tak Kunihiro
2021-10-04 9:29 ` Lars Ingebrigtsen
2021-10-05 3:03 ` Tak Kunihiro
2021-10-05 7:11 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CO6PR10MB54731E00BD7A9D4D3194E4E0F3AB9@CO6PR10MB5473.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=50928@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=larsi@gnus.org \
--cc=tkk@misasa.okayama-u.ac.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.