summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/seq.el
diff options
context:
space:
mode:
authorNicolas Petton <nicolas@petton.fr>2015-09-13 16:18:24 +0200
committerNicolas Petton <nicolas@petton.fr>2015-09-21 11:48:55 +0200
commit0a893f0cfa166d7f17d982c3f0503dff2be25f62 (patch)
treecdb172d4889e26e5502fee4dbbe5f3af1d5ebc57 /lisp/emacs-lisp/seq.el
parente2f0dd2f49d8638d20615bfa38e95a71202dd543 (diff)
downloademacs-0a893f0cfa166d7f17d982c3f0503dff2be25f62.tar.gz
Better docstring and parameter name for seq-find
* lisp/emacs-lisp/seq.el (seq-find): Improve the docstring and rename the parameter `sentinel' to `default'. * doc/lispref/sequences.texi (Sequence Functions): Update the documentation for `seq-find' accordingly.
Diffstat (limited to 'lisp/emacs-lisp/seq.el')
-rw-r--r--lisp/emacs-lisp/seq.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 4b50a0a9b7b..e0f17c0335d 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -270,18 +270,18 @@ If so, return the non-nil value returned by PRED."
(throw 'seq--break result))))
nil))
-(cl-defgeneric seq-find (pred seq &optional sentinel)
+(cl-defgeneric seq-find (pred seq &optional default)
"Return the first element for which (PRED element) is non-nil in SEQ.
-If no element is found, return SENTINEL or nil.
+If no element is found, return DEFAULT.
-Note that `seq-find' has an ambiguity if the found element is nil
-and if no SENTINEL is specified, as it cannot be known if an
-element was found or not."
+Note that `seq-find' has an ambiguity if the found element is
+identical to DEFAULT, as it cannot be known if an element was
+found or not."
(catch 'seq--break
(seq-doseq (elt seq)
(when (funcall pred elt)
(throw 'seq--break elt)))
- sentinel))
+ default))
(cl-defgeneric seq-count (pred seq)
"Return the number of elements for which (PRED element) is non-nil in SEQ."