From efb292b591bd46f0afb31cb685d9994d99f0b66c Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 2 May 2005 16:55:34 +0000 Subject: [PATCH] DEFMACRO now acepts lambda lists of the form (a . b) again (broken with previous optimizations) --- src/lsp/defmacro.lsp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lsp/defmacro.lsp b/src/lsp/defmacro.lsp index 11c8c4b0b..753690806 100644 --- a/src/lsp/defmacro.lsp +++ b/src/lsp/defmacro.lsp @@ -258,6 +258,13 @@ doc decls ppn env) (multiple-value-setq (decls body doc) (find-declarations body)) + ;; We turn (a . b) into (a &rest b) + ;; This is required because MEMBER (used below) does not like improper lists + (let ((cell (last vl))) + (when (rest cell) + (setq vl (nconc (butlast vl 0) (list '&rest (rest cell)))))) + ;; If we find an &environment variable in the lambda list, we take not of the + ;; name and remove it from the list so that DESTRUCTURE does not get confused (if (setq env (member '&environment vl :test #'eq)) (setq vl (nconc (ldiff vl env) (cddr env)) env (second env))