diff options
author | Kim F. Storm <storm@cua.dk> | 2006-10-10 16:11:57 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2006-10-10 16:11:57 +0000 |
commit | 1334cc0ca99a46c5fc51ce880aadbd6daf82e5d7 (patch) | |
tree | 262a74049de83632c1d10857c64110bad05cbf5d | |
parent | 3075e881465441a8a740c80489f6552903cf9e96 (diff) | |
download | emacs-1334cc0ca99a46c5fc51ce880aadbd6daf82e5d7.tar.gz |
(Sets And Lists): Add memql.
-rw-r--r-- | lispref/lists.texi | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lispref/lists.texi b/lispref/lists.texi index 1c6247d818c..17ed62a6d6c 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi @@ -1395,6 +1395,27 @@ The function @code{delq} offers a way to perform this operation destructively. See @ref{Sets And Lists}. @end defun +@defun memql object list +The function @code{member} tests to see whether @var{object} is a member +of @var{list}, comparing members with @var{object} using @code{eql}, +so floating point elements are compared by value. +If @var{object} is a member, @code{memql} returns a list starting with +its first occurrence in @var{list}. Otherwise, it returns @code{nil}. + +Compare this with @code{memq}: + +@example +@group +(memql 1.2 '(1.1 1.2 1.3) ; @r{@code{1.2} and @code{1.2} are @code{eql}.} + @result{} (1.2 1.3) +@end group +@group +(memq 1.2 '(1.1 1.2 1.3) ; @r{@code{1.2} and @code{1.2} are not @code{eq}.} + @result{} nil +@end group +@end example +@end defun + The following three functions are like @code{memq}, @code{delq} and @code{remq}, but use @code{equal} rather than @code{eq} to compare elements. @xref{Equality Predicates}. |