diff options
| author | Nicolas Petton | 2015-10-20 00:11:30 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2015-10-20 00:39:27 +0200 |
| commit | 04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0 (patch) | |
| tree | 2f5b54b355421705fd5dfec28bd9f88d16165e26 /doc/lispref | |
| parent | b911b4b25db93c8b574a5dc6f1258893b4aa18c4 (diff) | |
| download | emacs-04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0.tar.gz emacs-04d604e0553f76ea9ab266cf44c1d3f89f8bd2f0.zip | |
New function seq-position
* lisp/emacs-lisp/seq.el (seq-position): New function.
* test/automated/seq-tests.el: New tests for seq-position.
* doc/lispref/sequences.texi: Add documentation for `seq-position'.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/sequences.texi | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 0a6f4c6623c..8ecae7b58b5 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi | |||
| @@ -743,6 +743,25 @@ it is a function of two arguments to use instead of the default @code{equal}. | |||
| 743 | 743 | ||
| 744 | @end defun | 744 | @end defun |
| 745 | 745 | ||
| 746 | @defun seq-position sequence elt &optional function | ||
| 747 | This function returns the index of the first element in | ||
| 748 | @var{sequence} that is equal to @var{elt}. If the optional argument | ||
| 749 | @var{function} is non-@code{nil}, it is a function of two arguments to | ||
| 750 | use instead of the default @code{equal}. | ||
| 751 | |||
| 752 | @example | ||
| 753 | @group | ||
| 754 | (seq-position '(a b c) 'b) | ||
| 755 | @result{} 1 | ||
| 756 | @end group | ||
| 757 | @group | ||
| 758 | (seq-position '(a b c) 'd) | ||
| 759 | @result{} nil | ||
| 760 | @end group | ||
| 761 | @end example | ||
| 762 | @end defun | ||
| 763 | |||
| 764 | |||
| 746 | @defun seq-uniq sequence &optional function | 765 | @defun seq-uniq sequence &optional function |
| 747 | This function returns a list of the elements of @var{sequence} with | 766 | This function returns a list of the elements of @var{sequence} with |
| 748 | duplicates removed. If the optional argument @var{function} is non-@code{nil}, | 767 | duplicates removed. If the optional argument @var{function} is non-@code{nil}, |