From 6afc4856fe27cd153c82e520132df077ce03cb34 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Tue, 15 Nov 2005 19:49:26 +0000 Subject: [PATCH] Fixed infinite loop in the routine for inlining LAMBDA forms, plus other bugs related to variable names in macro expansion. --- src/cmp/cmplam.lsp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmp/cmplam.lsp b/src/cmp/cmplam.lsp index f4a0f58da..f50178e09 100644 --- a/src/cmp/cmplam.lsp +++ b/src/cmp/cmplam.lsp @@ -454,7 +454,7 @@ :format-control "Too few arguments for lambda form ~S" :format-arguments (cons 'LAMBDA lambda-form))))) let-vars)) - (do ((scan (cdr optionals) (cdddr optionals))) + (do ((scan (cdr optionals) (cdddr scan))) ((endp scan)) (let ((opt-var (first scan)) (opt-flag (third scan)) @@ -466,7 +466,7 @@ let-vars))) (apply-p (setf let-vars - (list* `(,opt-var (if ,opt-flag + (list* `(,opt-var (if ,apply-var (pop ,apply-var) ,opt-value)) `(,opt-flag ,apply-var) @@ -503,7 +503,7 @@ extra-stmts)))) (when (and key-flag (not allow-other-keys)) (push `(si::check-keyword ,rest ',all-keys) extra-stmts)) - `(let* ,(nreverse let-vars) + `(let* ,(nreverse (delete-if-not #'first let-vars)) ,@(multiple-value-bind (decl body) (si::find-declarations (rest lambda-form)) (append decl extra-stmts body)))))