diff options
| author | Kim F. Storm | 2006-10-10 16:11:57 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-10-10 16:11:57 +0000 |
| commit | 1334cc0ca99a46c5fc51ce880aadbd6daf82e5d7 (patch) | |
| tree | 262a74049de83632c1d10857c64110bad05cbf5d | |
| parent | 3075e881465441a8a740c80489f6552903cf9e96 (diff) | |
| download | emacs-1334cc0ca99a46c5fc51ce880aadbd6daf82e5d7.tar.gz emacs-1334cc0ca99a46c5fc51ce880aadbd6daf82e5d7.zip | |
(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 | |||
| 1395 | destructively. See @ref{Sets And Lists}. | 1395 | destructively. See @ref{Sets And Lists}. |
| 1396 | @end defun | 1396 | @end defun |
| 1397 | 1397 | ||
| 1398 | @defun memql object list | ||
| 1399 | The function @code{member} tests to see whether @var{object} is a member | ||
| 1400 | of @var{list}, comparing members with @var{object} using @code{eql}, | ||
| 1401 | so floating point elements are compared by value. | ||
| 1402 | If @var{object} is a member, @code{memql} returns a list starting with | ||
| 1403 | its first occurrence in @var{list}. Otherwise, it returns @code{nil}. | ||
| 1404 | |||
| 1405 | Compare this with @code{memq}: | ||
| 1406 | |||
| 1407 | @example | ||
| 1408 | @group | ||
| 1409 | (memql 1.2 '(1.1 1.2 1.3) ; @r{@code{1.2} and @code{1.2} are @code{eql}.} | ||
| 1410 | @result{} (1.2 1.3) | ||
| 1411 | @end group | ||
| 1412 | @group | ||
| 1413 | (memq 1.2 '(1.1 1.2 1.3) ; @r{@code{1.2} and @code{1.2} are not @code{eq}.} | ||
| 1414 | @result{} nil | ||
| 1415 | @end group | ||
| 1416 | @end example | ||
| 1417 | @end defun | ||
| 1418 | |||
| 1398 | The following three functions are like @code{memq}, @code{delq} and | 1419 | The following three functions are like @code{memq}, @code{delq} and |
| 1399 | @code{remq}, but use @code{equal} rather than @code{eq} to compare | 1420 | @code{remq}, but use @code{equal} rather than @code{eq} to compare |
| 1400 | elements. @xref{Equality Predicates}. | 1421 | elements. @xref{Equality Predicates}. |