mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-17 06:42:18 -08:00
src/lsp/defmacro.lsp: simplified the expander of DESTRUCTURING-BIND.
This commit is contained in:
parent
3447e860eb
commit
8734f8fcb6
1 changed files with 10 additions and 6 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue