unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32803: 26.1.50; cl-do: Add more literature in docstring
@ 2018-09-22 15:02 Tino Calancha
  2018-09-24  9:13 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Tino Calancha @ 2018-09-22 15:02 UTC (permalink / raw)
  To: 32803


Severity: wishlist
X-Debbugs-Cc: Eli Zaretskii <eliz@gnu.org>

Well, the subject say everything... the docstring of cl-do/cl-do*
resembles one of my phone calls :-(

Considering their names (do), it might be useful talk a bit about
what the macros do :-)
There is also room to say something on their arguments.

We could add a link to the proper info manual node as well, as in
the `cl-loop' docstring.

--8<-----------------------------cut here---------------start------------->8---
commit 026e683f999a5ad3958dc133fe2a46863a00afe8
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Sat Sep 22 23:45:31 2018 +0900

    * lisp/emacs-lisp/cl-macs.el(cl-do, cl-do*): Update docstring

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 0854e665b9..20c9fa454d 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1745,7 +1745,14 @@ cl--loop-build-ands
 
 ;;;###autoload
 (defmacro cl-do (steps endtest &rest body)
-  "The Common Lisp `do' loop.
+  "Bind variables and run BODY forms until END-TEST returns non-nil.
+Bind VAR initially to INIT; on successive iterations update VAR
+  with STEP form.
+On each iteration, check END-TEST before run BODY.
+Return RESULT, default nil.
+
+This is the Common Lisp `do' loop.
+For more details, see `cl-do' description in Info node `(cl) Iteration'.
 
 \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
   (declare (indent 2)
@@ -1757,7 +1764,14 @@ cl-do
 
 ;;;###autoload
 (defmacro cl-do* (steps endtest &rest body)
-  "The Common Lisp `do*' loop.
+  "Bind variables and run BODY forms until END-TEST returns non-nil.
+Bind VAR initially to INIT; on successive iterations update VAR
+  with STEP form.
+On each iteration, check END-TEST before run BODY.
+Return RESULT, default nil.
+
+This is to `cl-do' what `let*' is to `let'.
+For more details, see `cl-do*' description in Info node `(cl) Iteration'.
 
 \(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
   (declare (indent 2) (debug cl-do))

--8<-----------------------------cut here---------------end--------------->8---

In GNU Emacs 26.1.50 (build 16, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
Repository revision: 41cdda22c78eb0b00612ce25cdb356dd64322fcc





^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-09-29  9:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-22 15:02 bug#32803: 26.1.50; cl-do: Add more literature in docstring Tino Calancha
2018-09-24  9:13 ` Eli Zaretskii
2018-09-24 10:17   ` Tino Calancha
2018-09-24 16:43     ` Eric Abrahamsen
2018-09-24 16:58       ` Eli Zaretskii
2018-09-24 17:53         ` Eric Abrahamsen
2018-09-24 20:43           ` Tino Calancha
2018-09-27  4:08             ` Eric Abrahamsen
2018-09-28 20:13               ` Tino Calancha
2018-09-28 21:00                 ` Eric Abrahamsen
2018-09-29  9:10                   ` Tino Calancha

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).