emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 ace25f2: Clarify the seq-reduce documentation


From: Lars Ingebrigtsen
Subject: emacs-27 ace25f2: Clarify the seq-reduce documentation
Date: Thu, 15 Oct 2020 03:37:53 -0400 (EDT)

branch: emacs-27
commit ace25f206640b94d876d7d0966fcd9e512f81fc9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Clarify the seq-reduce documentation
    
    * doc/lispref/sequences.texi (Sequence Functions): Ditto.
    
    * lisp/emacs-lisp/seq.el (seq-reduce): Clarify the order of the
    arguments (bug#43995).
---
 doc/lispref/sequences.texi | 9 +++++++--
 lisp/emacs-lisp/seq.el     | 8 +++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index ca52369..952834b 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -658,8 +658,13 @@ for which @var{predicate} returns @code{nil}.
 @var{initial-value} and the first element of @var{sequence}, then calling
 @var{function} with that result and the second element of @var{sequence},
 then with that result and the third element of @var{sequence}, etc.
-@var{function} should be a function of two arguments.  If
-@var{sequence} is empty, this returns @var{initial-value} without
+@var{function} should be a function of two arguments.
+
+@var{function} is called with two arguments.  @var{intial-value}
+(and then the accumulated value) is used as the first argument, and
+the elements in @var{sequence} are used for the second argument.
+
+If @var{sequence} is empty, this returns @var{initial-value} without
 calling @var{function}.
 
 @example
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index e3037a7..42b145d 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -336,9 +336,11 @@ list."
   "Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE.
 
 Return the result of calling FUNCTION with INITIAL-VALUE and the
-first element of SEQUENCE, then calling FUNCTION with that result and
-the second element of SEQUENCE, then with that result and the third
-element of SEQUENCE, etc.
+first element of SEQUENCE, then calling FUNCTION with that result
+and the second element of SEQUENCE, then with that result and the
+third element of SEQUENCE, etc.  FUNCTION will be called with
+INITIAL-VALUE (and then the accumulated value) as the first
+argument, and the elements from SEQUENCE as the second argument.
 
 If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called."
   (if (seq-empty-p sequence)



reply via email to

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