GNU Info

Info Node: (emacs-lisp-intro.info)dolist dotimes

(emacs-lisp-intro.info)dolist dotimes


Next: Recursion Prev: while Up: Loops & Recursion
Enter node , (file) or (file)node

Save your time: `dolist' and `dotimes'
======================================

   In addition to `while', both `dolist' and `dotimes' provide for
looping.  Sometimes these are quicker to write than the equivalent
`while' loop.  Both are Lisp macros.  (Note: Macros. )

   `dolist' works like a `while' loop that `CDRs down a list':
`dolist' automatically shortens the list each time it loops--takes the
CDR of the list--and binds the CAR of each shorter version of the list
to the first of its arguments.

   `dotimes' loops a specific number of time: you specify the number.

dolist
dotimes

automatically generated by info2www version 1.2.2.9