diff options
| author | Nicolas Petton | 2015-09-28 21:11:05 +0200 |
|---|---|---|
| committer | Nicolas Petton | 2015-09-28 21:15:58 +0200 |
| commit | f0b71429b9fbfb5dc5a561321de42a39fc176809 (patch) | |
| tree | 221fcf3f39fb586596838b69517c60ab7be19563 /doc | |
| parent | 5526561b0c8416cbae492bc246eacd30f7b1daa8 (diff) | |
| download | emacs-f0b71429b9fbfb5dc5a561321de42a39fc176809.tar.gz emacs-f0b71429b9fbfb5dc5a561321de42a39fc176809.zip | |
Better documentation for seq-some
* doc/lispref/sequences.texi:
* lisp/emacs-lisp/seq.el: Update the documentation of seq-some to
guarantee that the returned value is the first non-nil value that
resulted from applying the predicate.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/sequences.texi | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index b85d5d4c1b1..2dc494aec5d 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi | |||
| @@ -558,9 +558,8 @@ calling @var{function}. | |||
| 558 | @end defun | 558 | @end defun |
| 559 | 559 | ||
| 560 | @defun seq-some predicate sequence | 560 | @defun seq-some predicate sequence |
| 561 | This function returns non-@code{nil} if @var{predicate} returns | 561 | This function returns the first non-@code{nil} value returned by |
| 562 | non-@code{nil} for any element of @var{sequence}. If so, the returned | 562 | applying @var{predicate} to each element of @var{sequence} in turn. |
| 563 | value is the value returned by @var{predicate}. | ||
| 564 | 563 | ||
| 565 | @example | 564 | @example |
| 566 | @group | 565 | @group |
| @@ -575,6 +574,10 @@ value is the value returned by @var{predicate}. | |||
| 575 | (seq-some #'null ["abc" 1 nil]) | 574 | (seq-some #'null ["abc" 1 nil]) |
| 576 | @result{} t | 575 | @result{} t |
| 577 | @end group | 576 | @end group |
| 577 | @group | ||
| 578 | (seq-some #'1+ [2 4 6]) | ||
| 579 | @result{} 3 | ||
| 580 | @end group | ||
| 578 | @end example | 581 | @end example |
| 579 | @end defun | 582 | @end defun |
| 580 | 583 | ||