diff --git a/src/CHANGELOG b/src/CHANGELOG index 8b9100c3a..de6192741 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -105,6 +105,10 @@ ECL 10.5.1: - ECL now captures SIGPIPE. + - In DEFMACRO forms, the &WHOLE argument may now be declared + ignorable. Formerly it was always referenced by the destructuring code of + the macro. + ;;; Local Variables: *** ;;; mode:text *** ;;; fill-column:79 *** diff --git a/src/lsp/defmacro.lsp b/src/lsp/defmacro.lsp index df0ebf984..b6da726d6 100644 --- a/src/lsp/defmacro.lsp +++ b/src/lsp/defmacro.lsp @@ -196,22 +196,22 @@ (3 (list 'CDDDR v)) )))) - (let* ((whole nil) + (let* ((whole (gensym)) (*dl* nil) (*key-check* nil) (*arg-check* nil)) (cond ((listp vl) (when (eq (first vl) '&whole) - (setq whole (second vl) vl (cddr vl)) - (when (listp whole) - (let ((new-whole (gensym))) - (dm-vl whole new-whole nil) - (setq whole new-whole))))) + (let ((named-whole (second vl))) + (setq vl (cddr vl)) + (if (listp named-whole) + (dm-vl named-whole whole nil) + (setq *dl* (list (list named-whole whole))))))) ((symbolp vl) (setq vl (list '&rest vl))) (t (error "The destructuring-lambda-list ~s is not a list." vl))) - (if (null whole) (setq whole (gensym))) - (values (dm-vl vl whole macro) whole (nreverse *dl*) *key-check* *arg-check*)))) + (values (dm-vl vl whole macro) whole (nreverse *dl*) + *key-check* *arg-check*)))) ;;; valid lambda-list to DEFMACRO is: ;;;