Skip to content

Commit

Permalink
functions by make-pusher no longer returns their arguments arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbysmith007 committed Feb 1, 2012
1 parent 28ad516 commit fc9061d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions collectors.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,13 @@ current list of values."

(defun make-pusher (&optional initial-value (collect-nil t))
"Create a function which collects values as by PUSH."
(let ((value initial-value))
(let ((value (copy-list initial-value)))
(lambda (&rest items)
(declare (dynamic-extent items))
(if items
(progn
(dolist (i items)
(when (or collect-nil i)
(push i value)))
items)
(dolist (i items)
(when (or collect-nil i)
(push i value)))
value))))

(defmacro with-appender ((name &optional initial-value) &body body)
Expand Down

0 comments on commit fc9061d

Please sign in to comment.