emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f0b7142 2/2: Better documentation for seq-some


From: Nicolas Petton
Subject: [Emacs-diffs] master f0b7142 2/2: Better documentation for seq-some
Date: Mon, 28 Sep 2015 19:16:08 +0000

branch: master
commit f0b71429b9fbfb5dc5a561321de42a39fc176809
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>

    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.
---
 doc/lispref/sequences.texi |    9 ++++++---
 lisp/emacs-lisp/seq.el     |    3 +--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index b85d5d4..2dc494a 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -558,9 +558,8 @@ calling @var{function}.
 @end defun
 
 @defun seq-some predicate sequence
-  This function returns address@hidden if @var{predicate} returns
address@hidden for any element of @var{sequence}.  If so, the returned
-value is the value returned by @var{predicate}.
+  This function returns the first address@hidden value returned by
+applying @var{predicate} to each element of @var{sequence} in turn.
 
 @example
 @group
@@ -575,6 +574,10 @@ value is the value returned by @var{predicate}.
 (seq-some #'null ["abc" 1 nil])
 @result{} t
 @end group
address@hidden
+(seq-some #'1+ [2 4 6])
address@hidden 3
address@hidden group
 @end example
 @end defun
 
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index e0f17c0..a63447d 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -261,8 +261,7 @@ If SEQ is empty, return INITIAL-VALUE and FUNCTION is not 
called."
     t))
 
 (cl-defgeneric seq-some (pred seq)
-  "Return non-nil if (PRED element) is non-nil for any element in SEQ, nil 
otherwise.
-If so, return the non-nil value returned by PRED."
+  "Return the first value for which if (PRED element) is non-nil for in SEQ."
   (catch 'seq--break
     (seq-doseq (elt seq)
       (let ((result (funcall pred elt)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]