loop: destructuring: allow values shorter than variables
We achieve that by adding &optional to every sublist. Fixes #605.
This commit is contained in:
parent
b2c9ea8c6e
commit
809b9de86f
1 changed files with 6 additions and 2 deletions
|
|
@ -659,8 +659,12 @@ collected result will be returned as the value of the LOOP."
|
|||
(cond
|
||||
((null tree) (car (push (gensym) *ignores*)))
|
||||
((atom tree) tree)
|
||||
(t (cons (subst-gensyms-for-nil (car tree))
|
||||
(subst-gensyms-for-nil (cdr tree))))))
|
||||
((atom (cdr tree))
|
||||
(cons (subst-gensyms-for-nil (car tree))
|
||||
(subst-gensyms-for-nil (cdr tree))))
|
||||
(t
|
||||
(list* '&optional
|
||||
(mapcar #'subst-gensyms-for-nil tree)))))
|
||||
|
||||
(defun loop-build-destructuring-bindings (crocks forms)
|
||||
(if crocks
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue