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

Diff of /src/code/macros.lisp

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

revision 1.79 by toy, Fri Nov 1 17:41:53 2002 UTC revision 1.80 by toy, Wed Nov 20 16:15:39 2002 UTC
# Line 1563  Line 1563 
1563  ;;; don't want to use IGNORABLE on what might be a special var.  ;;; don't want to use IGNORABLE on what might be a special var.
1564  ;;;  ;;;
1565  (defmacro dolist ((var list &optional (result nil)) &body body)  (defmacro dolist ((var list &optional (result nil)) &body body)
1566    (let ((n-list (gensym)))    (multiple-value-bind (forms decls)
1567      `(do ((,n-list ,list (cdr ,n-list)))        (parse-body body nil nil)
1568           ((endp ,n-list)      (let ((n-list (gensym)))
1569            ,@(if result        `(do* ((,n-list ,list (cdr ,n-list)))
1570                  `((let ((,var nil))          ((endp ,n-list)
1571                      ,var           ,@(if result
1572                      ,result))                 `((let ((,var nil))
1573                  '(nil)))                     ,var
1574         (let ((,var (car ,n-list)))                     ,result))
1575           ,@body))))                 '(nil)))
1576            (let ((,var (car ,n-list)))
1577              ,@decls
1578              (tagbody
1579                 ,@forms))))))
1580    
1581    
1582  (defmacro do (varlist endlist &body (body decls))  (defmacro do (varlist endlist &body (body decls))

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80

  ViewVC Help
Powered by ViewVC 1.1.5