/[cmucl]/src/code/extensions.lisp
ViewVC logotype

Diff of /src/code/extensions.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by pw, Tue Mar 13 16:52:14 2001 UTC revision 1.26 by pmai, Thu Sep 19 17:48:17 2002 UTC
# Line 172  Line 172 
172           ,setter))))           ,setter))))
173    
174    
175  (defmacro dovector ((elt vector) &rest forms)  (defmacro dovector ((elt vector &optional default) &rest forms)
176    "Just like dolist, but with one-dimensional arrays."    "Just like dolist, but with one-dimensional arrays."
177    (let ((index (gensym))    (let ((index (gensym))
178          (length (gensym))          (length (gensym))
# Line 180  Line 180 
180      `(let ((,vec ,vector))      `(let ((,vec ,vector))
181         (do ((,index 0 (1+ ,index))         (do ((,index 0 (1+ ,index))
182              (,length (length ,vec)))              (,length (length ,vec)))
183             ((>= ,index ,length) nil)             ((>= ,index ,length) ,default)
184           (let ((,elt (aref ,vec ,index)))           (let ((,elt (aref ,vec ,index)))
185             ,@forms)))))             ,@forms)))))
186    

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.5