projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove a stray debugging PRINT
[sbcl.git]
/
src
/
code
/
destructuring-bind.lisp
diff --git
a/src/code/destructuring-bind.lisp
b/src/code/destructuring-bind.lisp
index
58bc4c0
..
c485b75
100644
(file)
--- a/
src/code/destructuring-bind.lisp
+++ b/
src/code/destructuring-bind.lisp
@@
-9,15
+9,19
@@
(in-package "SB!IMPL")
(in-package "SB!IMPL")
-(defmacro-mundanely destructuring-bind (lambda-list arg-list &rest body)
+(defmacro-mundanely destructuring-bind (lambda-list expression &body body)
#!+sb-doc
#!+sb-doc
- "Bind the variables in LAMBDA-LIST to the contents of ARG-LIST."
- (let ((arg-list-name (gensym "ARG-LIST-")))
+ "Bind the variables in LAMBDA-LIST to the corresponding values in the
+tree structure resulting from the evaluation of EXPRESSION."
+ (let ((whole-name (gensym "WHOLE")))
(multiple-value-bind (body local-decls)
(multiple-value-bind (body local-decls)
- (parse-defmacro lambda-list arg-list-name body nil 'destructuring-bind
+ (parse-defmacro lambda-list whole-name body nil 'destructuring-bind
:anonymousp t
:doc-string-allowed nil
:wrap-block nil)
:anonymousp t
:doc-string-allowed nil
:wrap-block nil)
- `(let ((,arg-list-name ,arg-list))
+ `(let ((,whole-name ,expression))
+ ;; This declaration-as-assertion should protect us from
+ ;; (DESTRUCTURING-BIND (X . Y) 'NOT-A-LIST ...).
+ (declare (type list ,whole-name))
,@local-decls
,body))))
,@local-decls
,body))))