aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDave Love2000-01-28 22:42:15 +0000
committerDave Love2000-01-28 22:42:15 +0000
commit7e16e199058bde427aa7c2839a596343a174e40c (patch)
tree04cb1c993ffbed29d491ec10fc7f1adb9c10873b /lisp
parent7df8508400b15fe2b5c1e6768f34e7d0ecf6b0f2 (diff)
downloademacs-7e16e199058bde427aa7c2839a596343a174e40c.tar.gz
emacs-7e16e199058bde427aa7c2839a596343a174e40c.zip
Remove dotimes, dolist.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el26
1 files changed, 0 insertions, 26 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 85287507f58..63354c861ef 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1122,32 +1122,6 @@ Format is: (do* ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)"
1122 (apply 'append sets))))))) 1122 (apply 'append sets)))))))
1123 (or (cdr endtest) '(nil))))) 1123 (or (cdr endtest) '(nil)))))
1124 1124
1125(defmacro dolist (spec &rest body)
1126 "(dolist (VAR LIST [RESULT]) BODY...): loop over a list.
1127Evaluate BODY with VAR bound to each `car' from LIST, in turn.
1128Then evaluate RESULT to get return value, default nil."
1129 (let ((temp (gensym "--dolist-temp--")))
1130 (list 'block nil
1131 (list* 'let (list (list temp (nth 1 spec)) (car spec))
1132 (list* 'while temp (list 'setq (car spec) (list 'car temp))
1133 (append body (list (list 'setq temp
1134 (list 'cdr temp)))))
1135 (if (cdr (cdr spec))
1136 (cons (list 'setq (car spec) nil) (cdr (cdr spec)))
1137 '(nil))))))
1138
1139(defmacro dotimes (spec &rest body)
1140 "(dotimes (VAR COUNT [RESULT]) BODY...): loop a certain number of times.
1141Evaluate BODY with VAR bound to successive integers from 0, inclusive,
1142to COUNT, exclusive. Then evaluate RESULT to get return value, default
1143nil."
1144 (let ((temp (gensym "--dotimes-temp--")))
1145 (list 'block nil
1146 (list* 'let (list (list temp (nth 1 spec)) (list (car spec) 0))
1147 (list* 'while (list '< (car spec) temp)
1148 (append body (list (list 'incf (car spec)))))
1149 (or (cdr (cdr spec)) '(nil))))))
1150
1151(defmacro do-symbols (spec &rest body) 1125(defmacro do-symbols (spec &rest body)
1152 "(dosymbols (VAR [OBARRAY [RESULT]]) BODY...): loop over all symbols. 1126 "(dosymbols (VAR [OBARRAY [RESULT]]) BODY...): loop over all symbols.
1153Evaluate BODY with VAR bound to each interned symbol, or to each symbol 1127Evaluate BODY with VAR bound to each interned symbol, or to each symbol