/[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.34 by wlott, Thu Aug 13 13:31:28 1992 UTC revision 1.35 by ram, Tue Sep 1 17:41:52 1992 UTC
# Line 1436  Line 1436 
1436    
1437  ;;; We repeatedly bind the var instead of setting it so that we never give the  ;;; We repeatedly bind the var instead of setting it so that we never give the
1438  ;;; var a random value such as NIL (which might conflict with a declaration).  ;;; var a random value such as NIL (which might conflict with a declaration).
1439  ;;; ### Might not be legal...  ;;; If there is a result form, we introduce a gratitous binding of the variable
1440    ;;; to NIL w/o the declarations, then evaluate the result form in that
1441    ;;; environment.  We spuriously reference the gratuitous variable, since we
1442    ;;; don't want to use IGNORABLE on what might be a special var.
1443  ;;;  ;;;
1444  (defmacro dolist ((var list &optional (result nil)) &body body)  (defmacro dolist ((var list &optional (result nil)) &body body)
1445    (let ((n-list (gensym)))    (let ((n-list (gensym)))
1446      `(do ((,n-list ,list (cdr ,n-list)))      `(do ((,n-list ,list (cdr ,n-list)))
1447           ((endp ,n-list)           ((endp ,n-list)
1448            (let ((,var nil))            ,@(if result
1449              (declare (ignorable ,var))                  `((let ((,var nil))
1450              ,result))                      ,var
1451                        ,result))
1452                    '(nil)))
1453         (let ((,var (car ,n-list)))         (let ((,var (car ,n-list)))
1454           ,@body))))           ,@body))))
1455    

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.5