author | Alan Dipert
<alan@dipert.org> 2021-08-04 23:51:44 UTC |
committer | Alan Dipert
<alan@dipert.org> 2021-08-04 23:51:44 UTC |
parent | 13450b42b5a7cd3ee7558c1562c87009ad9a5d3b |
boot.lisp | +7 | -0 |
jacl-tests.lisp | +5 | -0 |
diff --git a/boot.lisp b/boot.lisp index fe7b909..c6b9152 100644 --- a/boot.lisp +++ b/boot.lisp @@ -559,6 +559,13 @@ ((not ,list#) ,(caddr binding)) ,@body))) +(%export 'dotimes) +(defmacro dotimes (binding &rest body) + `(do ((,(car binding) 0 (1+ ,(car binding)))) + ((eql ,(car binding) ,(cadr binding)) + ,(caddr binding)) + ,@body)) + ;; designators (defun %designated-string (x) diff --git a/jacl-tests.lisp b/jacl-tests.lisp index 689c9ff..971473d 100644 --- a/jacl-tests.lisp +++ b/jacl-tests.lisp @@ -198,6 +198,11 @@ (dolist (x '(1 2 3) i) (setq i (+ i x)))))) +(deftest "DOTIMES" + (let ((x 0)) + (dotimes (i 3 (assert= x 3)) + (setq x (1+ x))))) + (start-tests) ;; ;; (in-module "Control operators")