aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-02-14 10:07:43 +0000
committerRichard M. Stallman2005-02-14 10:07:43 +0000
commit85831f9a60cca17cfe2fc201667c599091e9cc50 (patch)
tree7eb9ffcd381c2cd310901fda89bc93542ce6fafb
parentb57bdd74720b691421e35d705324d1e5834371e4 (diff)
downloademacs-85831f9a60cca17cfe2fc201667c599091e9cc50.tar.gz
emacs-85831f9a60cca17cfe2fc201667c599091e9cc50.zip
(Combining Conditions): Wording cleanup.
(Iteration): dolist and dotimes bind VAR locally. (Cleanups): Xref to Atomic Changes.
-rw-r--r--lispref/control.texi23
1 files changed, 13 insertions, 10 deletions
diff --git a/lispref/control.texi b/lispref/control.texi
index e2a1e26b170..760e7bb82de 100644
--- a/lispref/control.texi
+++ b/lispref/control.texi
@@ -346,8 +346,8 @@ Here is a more realistic example of using @code{and}:
346Note that @code{(car foo)} is not executed if @code{(consp foo)} returns 346Note that @code{(car foo)} is not executed if @code{(consp foo)} returns
347@code{nil}, thus avoiding an error. 347@code{nil}, thus avoiding an error.
348 348
349@code{and} can be expressed in terms of either @code{if} or @code{cond}. 349@code{and} expressions can also be written using either @code{if} or
350For example: 350@code{cond}. Here's how:
351 351
352@example 352@example
353@group 353@group
@@ -476,11 +476,11 @@ write two common kinds of loops.
476 476
477@defmac dolist (var list [result]) body@dots{} 477@defmac dolist (var list [result]) body@dots{}
478@tindex dolist 478@tindex dolist
479This construct executes @var{body} once for each element of @var{list}, 479This construct executes @var{body} once for each element of
480using the variable @var{var} to hold the current element. Then it 480@var{list}, binding the variable @var{var} locally to hold the current
481returns the value of evaluating @var{result}, or @code{nil} if 481element. Then it returns the value of evaluating @var{result}, or
482@var{result} is omitted. For example, here is how you could use 482@code{nil} if @var{result} is omitted. For example, here is how you
483@code{dolist} to define the @code{reverse} function: 483could use @code{dolist} to define the @code{reverse} function:
484 484
485@example 485@example
486(defun reverse (list) 486(defun reverse (list)
@@ -493,8 +493,8 @@ returns the value of evaluating @var{result}, or @code{nil} if
493@defmac dotimes (var count [result]) body@dots{} 493@defmac dotimes (var count [result]) body@dots{}
494@tindex dotimes 494@tindex dotimes
495This construct executes @var{body} once for each integer from 0 495This construct executes @var{body} once for each integer from 0
496(inclusive) to @var{count} (exclusive), using the variable @var{var} to 496(inclusive) to @var{count} (exclusive), binding the variable @var{var}
497hold the integer for the current iteration. Then it returns the value 497to the integer for the current iteration. Then it returns the value
498of evaluating @var{result}, or @code{nil} if @var{result} is omitted. 498of evaluating @var{result}, or @code{nil} if @var{result} is omitted.
499Here is an example of using @code{dotimes} to do something 100 times: 499Here is an example of using @code{dotimes} to do something 100 times:
500 500
@@ -1167,7 +1167,10 @@ and their conditions.
1167 1167
1168 The @code{unwind-protect} construct is essential whenever you 1168 The @code{unwind-protect} construct is essential whenever you
1169temporarily put a data structure in an inconsistent state; it permits 1169temporarily put a data structure in an inconsistent state; it permits
1170you to make the data consistent again in the event of an error or throw. 1170you to make the data consistent again in the event of an error or
1171throw. (Another more specific cleanup construct that is used only for
1172changes in buffer contents is the atomic change group; @ref{Atomic
1173Changes}.)
1171 1174
1172@defspec unwind-protect body-form cleanup-forms@dots{} 1175@defspec unwind-protect body-form cleanup-forms@dots{}
1173@cindex cleanup forms 1176@cindex cleanup forms