Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Commit

Permalink
Made expand-slot-forms ignore NIL variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapp committed May 29, 2011
1 parent 0870b47 commit 15f457a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions let-plus.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ the second value."

(defun expand-slot-forms (slots accessor-generator)
"Return a list of expanded bindings, calling (ACCESSOR-GENERATOR KEY)"
(mapcar (lambda (entry)
(destructuring-bind (variable &optional (key variable))
(ensure-list entry)
`(,variable ,(funcall accessor-generator key))))
slots))
(let (bindings)
(loop for entry :in slots do
(destructuring-bind (variable &optional (key variable))
(ensure-list entry)
(when variable
(push `(,variable ,(funcall accessor-generator key)) bindings))))
(nreverse bindings)))

(defun expand-entry-forms (entries accessor-generator)
"Return a list of expanded bindings from , calling (ACESSOR-GENERATOR KEY
Expand Down

0 comments on commit 15f457a

Please sign in to comment.