X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fiterate.lisp;h=a5b2bdf96c61d08eee1f2452d41c64a530ce517c;hb=2716573f357f204c5f546d1d34d285dd24ff43a1;hp=59dbbc87dfd06b875c6d3ce0aaa5e8a75521448e;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/pcl/iterate.lisp b/src/pcl/iterate.lisp index 59dbbc8..a5b2bdf 100644 --- a/src/pcl/iterate.lisp +++ b/src/pcl/iterate.lisp @@ -22,11 +22,9 @@ ;;;; specification. (in-package "SB-ITERATE") - -(sb-int:file-comment - "$Header$") -;;; Are warnings to be issued for iterate/gather forms that aren't optimized? +;;; Are warnings to be issued for iterate/gather forms that aren't +;;; optimized? ;;; NIL => never ;;; :USER => those resulting from user code ;;; T => always, even if it's the iteration macro that's suboptimal. @@ -36,46 +34,6 @@ (defmacro iterate (clauses &body body &environment env) (optimize-iterate-form clauses body env)) -(defun - simple-expand-iterate-form - (clauses body) - - ;; Expand ITERATE. This is the "formal semantics" expansion, which we never - ;; use. - (let* - ((block-name (gensym)) - (bound-var-lists (mapcar #'(lambda (clause) - (let ((names (first clause))) - (if (listp names) - names - (list names)))) - clauses)) - (generator-vars (mapcar #'(lambda (clause) - (declare (ignore clause)) - (gensym)) - clauses))) - `(block ,block-name - (let* - ,(mapcan #'(lambda (gvar clause var-list) - ;; For each clause, bind a generator temp to the clause, - ;; then bind the specified var(s). - (cons (list gvar (second clause)) - (copy-list var-list))) - generator-vars clauses bound-var-lists) - - ;; Note bug in formal semantics: there can be declarations in the head - ;; of BODY; they go here, rather than inside loop. - (loop - ,@(mapcar - #'(lambda (var-list gen-var) - ;; Set each bound variable (or set of vars) to the result of - ;; calling the corresponding generator. - `(multiple-value-setq ,var-list - (funcall ,gen-var #'(lambda nil (return-from - ,block-name))))) - bound-var-lists generator-vars) - ,@body))))) - ;;; temporary variable names used by ITERATE expansions (defparameter *iterate-temp-vars-list* '(iterate-temp-1 iterate-temp-2 iterate-temp-3 iterate-temp-4