Mercurial > emacs
changeset 73326:c8f96b8b18b7
(Sets And Lists): Add memql.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Tue, 10 Oct 2006 16:11:57 +0000 |
parents | 0c1743a61b91 |
children | 5e9926b80061 |
files | lispref/lists.texi |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lispref/lists.texi Tue Oct 10 16:11:48 2006 +0000 +++ b/lispref/lists.texi Tue Oct 10 16:11:57 2006 +0000 @@ -1395,6 +1395,27 @@ 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}.