diff options
| author | Basil L. Contovounesios | 2019-10-07 17:54:18 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2019-10-07 17:54:18 +0100 |
| commit | bb596474207632ac5cfd139baad000c5470f6dae (patch) | |
| tree | d2d21a50869403d6be6b346ca07a31577011fb81 | |
| parent | 6fe58ff08865c4fd1ffaf3b01e4f1bbaa1c98ed3 (diff) | |
| download | emacs-bb596474207632ac5cfd139baad000c5470f6dae.tar.gz emacs-bb596474207632ac5cfd139baad000c5470f6dae.zip | |
Improve recent doc fix for cl-reduce
* lisp/emacs-lisp/cl-seq.el: (cl-reduce): Clarify treatment of
:INITIAL-VALUE when :FROM-END is non-nil. Improve wording when SEQ
is empty and :INITIAL-VALUE is unspecified (bug#37400). Describe
behavior when SEQ comprises a single element.
| -rw-r--r-- | lisp/emacs-lisp/cl-seq.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index 520d450481f..df3fbe89e95 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el | |||
| @@ -129,14 +129,16 @@ second element of SEQ, then calling FUNCTION with that result and | |||
| 129 | the third element of SEQ, then with that result and the fourth | 129 | the third element of SEQ, then with that result and the fourth |
| 130 | element of SEQ, etc. | 130 | element of SEQ, etc. |
| 131 | 131 | ||
| 132 | If :INITIAL-VALUE is specified, it is added to the front of SEQ. | 132 | If :INITIAL-VALUE is specified, it is logically added to the |
| 133 | If SEQ is empty, return :INITIAL-VALUE and FUNCTION is not | 133 | front of SEQ (or the back if :FROM-END is non-nil). If SEQ is |
| 134 | called. | 134 | empty, return :INITIAL-VALUE and FUNCTION is not called. |
| 135 | 135 | ||
| 136 | If SEQ is empty and no :INITIAL-VALUE is given, then the function | 136 | If SEQ is empty and no :INITIAL-VALUE is specified, then return |
| 137 | is called with zero arguments, and reduce returns whatever | 137 | the result of calling FUNCTION with zero arguments. This is the |
| 138 | function does. This is the only case where the function is called | 138 | only case where FUNCTION is called with fewer than two arguments. |
| 139 | with other than two arguments. | 139 | |
| 140 | If SEQ contains exactly one element and no :INITIAL-VALUE is | ||
| 141 | specified, then return that element and FUNCTION is not called. | ||
| 140 | 142 | ||
| 141 | \n(fn FUNCTION SEQ [KEYWORD VALUE]...)" | 143 | \n(fn FUNCTION SEQ [KEYWORD VALUE]...)" |
| 142 | (cl--parsing-keywords (:from-end (:start 0) :end :initial-value :key) () | 144 | (cl--parsing-keywords (:from-end (:start 0) :end :initial-value :key) () |