From 8734f8fcb656c2083c397b4113fa3ade1d12ee24 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sat, 14 Nov 2009 16:09:04 +0100 Subject: [PATCH] src/lsp/defmacro.lsp: simplified the expander of DESTRUCTURING-BIND. --- src/lsp/defmacro.lsp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lsp/defmacro.lsp b/src/lsp/defmacro.lsp index 9de121cb1..97a65da6c 100644 --- a/src/lsp/defmacro.lsp +++ b/src/lsp/defmacro.lsp @@ -323,12 +323,16 @@ ;;; | . sym } ;;; ) -(defmacro destructuring-bind (vl list &body body &aux (decls nil)) - (multiple-value-setq (decls body) (find-declarations body)) - (multiple-value-bind (ppn whole *dl* *key-check* *arg-check*) - (destructure vl nil) - (setq body (nconc decls (append *arg-check* *key-check* body))) - (list* 'let* (cons (list whole list) *dl*) body))) +(defmacro destructuring-bind (vl list &body body) + (multiple-value-bind (decls body) + (find-declarations body) + (multiple-value-bind (ppn whole *dl* *key-check* *arg-check*) + (destructure vl nil) + `(let* ((,whole ,list) ,@*dl*) + ,@decls + ,@*arg-check* + ,@*key-check* + ,@body)))) (defun warn (&rest foo) nil)