DO to DOTIMES
authorpdn <pnathan@vandals.uidaho.edu>
Mon, 17 Feb 2014 06:05:47 +0000 (22:05 -0800)
committerpdn <pnathan@vandals.uidaho.edu>
Mon, 17 Feb 2014 06:05:47 +0000 (22:05 -0800)
src/list.lisp

index 368d098..8efb95a 100644 (file)
   (when (< size 0)
     (error "Size must be non-negative"))
   (let ((newlist))
-    (do ((i 0))
-        ((= i size))
-      (push initial-element newlist)
-      (incf i))
-    newlist))
+    (dotimes (i size newlist)
+      (push initial-element newlist))))
 
 (defun map1 (func list)
   (with-collect