Mention seq-uniq' in
delete-dups' documentation
* doc/lispref/lists.texi (Sets And Lists): Mention `seq-uniq' (bug#50928). * lisp/subr.el (delete-dups): Link to `seq-uniq' in doc string.
This commit is contained in:
parent
0a7bab689c
commit
b431f54c1b
2 changed files with 10 additions and 9 deletions
|
@ -1227,13 +1227,13 @@ this is not guaranteed to happen):
|
||||||
@cindex lists as sets
|
@cindex lists as sets
|
||||||
@cindex sets
|
@cindex sets
|
||||||
|
|
||||||
A list can represent an unordered mathematical set---simply consider a
|
A list can represent an unordered mathematical set---simply consider
|
||||||
value an element of a set if it appears in the list, and ignore the
|
a value an element of a set if it appears in the list, and ignore the
|
||||||
order of the list. To form the union of two sets, use @code{append} (as
|
order of the list. To form the union of two sets, use @code{append}
|
||||||
long as you don't mind having duplicate elements). You can remove
|
(as long as you don't mind having duplicate elements). You can remove
|
||||||
@code{equal} duplicates using @code{delete-dups}. Other useful
|
@code{equal} duplicates using @code{delete-dups} or @code{seq-uniq}.
|
||||||
functions for sets include @code{memq} and @code{delq}, and their
|
Other useful functions for sets include @code{memq} and @code{delq},
|
||||||
@code{equal} versions, @code{member} and @code{delete}.
|
and their @code{equal} versions, @code{member} and @code{delete}.
|
||||||
|
|
||||||
@cindex CL note---lack @code{union}, @code{intersection}
|
@cindex CL note---lack @code{union}, @code{intersection}
|
||||||
@quotation
|
@quotation
|
||||||
|
@ -1489,7 +1489,8 @@ comparison.
|
||||||
This function destructively removes all @code{equal} duplicates from
|
This function destructively removes all @code{equal} duplicates from
|
||||||
@var{list}, stores the result in @var{list} and returns it. Of
|
@var{list}, stores the result in @var{list} and returns it. Of
|
||||||
several @code{equal} occurrences of an element in @var{list},
|
several @code{equal} occurrences of an element in @var{list},
|
||||||
@code{delete-dups} keeps the first one.
|
@code{delete-dups} keeps the first one. See @code{seq-uniq} for
|
||||||
|
non-destructive operation (@pxref{Sequence Functions}).
|
||||||
@end defun
|
@end defun
|
||||||
|
|
||||||
See also the function @code{add-to-list}, in @ref{List Variables},
|
See also the function @code{add-to-list}, in @ref{List Variables},
|
||||||
|
|
|
@ -696,7 +696,7 @@ If N is omitted or nil, remove the last element."
|
||||||
"Destructively remove `equal' duplicates from LIST.
|
"Destructively remove `equal' duplicates from LIST.
|
||||||
Store the result in LIST and return it. LIST must be a proper list.
|
Store the result in LIST and return it. LIST must be a proper list.
|
||||||
Of several `equal' occurrences of an element in LIST, the first
|
Of several `equal' occurrences of an element in LIST, the first
|
||||||
one is kept."
|
one is kept. See `seq-uniq' for non-destructive operation."
|
||||||
(let ((l (length list)))
|
(let ((l (length list)))
|
||||||
(if (> l 100)
|
(if (> l 100)
|
||||||
(let ((hash (make-hash-table :test #'equal :size l))
|
(let ((hash (make-hash-table :test #'equal :size l))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue