comparison lispref/control.texi @ 71711:68a288c68acc

(Iteration): Remove @tindex.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 08 Jul 2006 18:12:14 +0000
parents 067115a6e738
children dca11242db4e
comparison
equal deleted inserted replaced
71710:dbbc0b93cfeb 71711:68a288c68acc
473 473
474 The @code{dolist} and @code{dotimes} macros provide convenient ways to 474 The @code{dolist} and @code{dotimes} macros provide convenient ways to
475 write two common kinds of loops. 475 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
479 This construct executes @var{body} once for each element of 478 This construct executes @var{body} once for each element of
480 @var{list}, binding the variable @var{var} locally to hold the current 479 @var{list}, binding the variable @var{var} locally to hold the current
481 element. Then it returns the value of evaluating @var{result}, or 480 element. Then it returns the value of evaluating @var{result}, or
482 @code{nil} if @var{result} is omitted. For example, here is how you 481 @code{nil} if @var{result} is omitted. For example, here is how you
483 could use @code{dolist} to define the @code{reverse} function: 482 could use @code{dolist} to define the @code{reverse} function:
489 (setq value (cons elt value))))) 488 (setq value (cons elt value)))))
490 @end example 489 @end example
491 @end defmac 490 @end defmac
492 491
493 @defmac dotimes (var count [result]) body@dots{} 492 @defmac dotimes (var count [result]) body@dots{}
494 @tindex dotimes
495 This construct executes @var{body} once for each integer from 0 493 This construct executes @var{body} once for each integer from 0
496 (inclusive) to @var{count} (exclusive), binding the variable @var{var} 494 (inclusive) to @var{count} (exclusive), binding the variable @var{var}
497 to the integer for the current iteration. Then it returns the value 495 to the integer for the current iteration. Then it returns the value
498 of evaluating @var{result}, or @code{nil} if @var{result} is omitted. 496 of evaluating @var{result}, or @code{nil} if @var{result} is omitted.
499 Here is an example of using @code{dotimes} to do something 100 times: 497 Here is an example of using @code{dotimes} to do something 100 times: