comparison lisp/subr.el @ 51817:5e9d88e4fcff

(dolist, dotimes): Doc fix.
author Markus Rost <rost@math.uni-bielefeld.de>
date Tue, 08 Jul 2003 16:56:56 +0000
parents 3e0f0ad2d93d
children b7fa62a1a49d
comparison
equal deleted inserted replaced
51816:196b83881b7b 51817:5e9d88e4fcff
112 (defmacro dolist (spec &rest body) 112 (defmacro dolist (spec &rest body)
113 "Loop over a list. 113 "Loop over a list.
114 Evaluate BODY with VAR bound to each car from LIST, in turn. 114 Evaluate BODY with VAR bound to each car from LIST, in turn.
115 Then evaluate RESULT to get return value, default nil. 115 Then evaluate RESULT to get return value, default nil.
116 116
117 \(dolist (VAR LIST [RESULT]) BODY...)" 117 \(fn (VAR LIST [RESULT]) BODY...)"
118 (declare (indent 1) (debug ((symbolp form &optional form) body))) 118 (declare (indent 1) (debug ((symbolp form &optional form) body)))
119 (let ((temp (make-symbol "--dolist-temp--"))) 119 (let ((temp (make-symbol "--dolist-temp--")))
120 `(let ((,temp ,(nth 1 spec)) 120 `(let ((,temp ,(nth 1 spec))
121 ,(car spec)) 121 ,(car spec))
122 (while ,temp 122 (while ,temp
130 "Loop a certain number of times. 130 "Loop a certain number of times.
131 Evaluate BODY with VAR bound to successive integers running from 0, 131 Evaluate BODY with VAR bound to successive integers running from 0,
132 inclusive, to COUNT, exclusive. Then evaluate RESULT to get 132 inclusive, to COUNT, exclusive. Then evaluate RESULT to get
133 the return value (nil if RESULT is omitted). 133 the return value (nil if RESULT is omitted).
134 134
135 \(dotimes (VAR COUNT [RESULT]) BODY...)" 135 \(fn (VAR COUNT [RESULT]) BODY...)"
136 (declare (indent 1) (debug dolist)) 136 (declare (indent 1) (debug dolist))
137 (let ((temp (make-symbol "--dotimes-temp--")) 137 (let ((temp (make-symbol "--dotimes-temp--"))
138 (start 0) 138 (start 0)
139 (end (nth 1 spec))) 139 (end (nth 1 spec)))
140 `(let ((,temp ,end) 140 `(let ((,temp ,end)