Skip to content

Commit

Permalink
added with-collector-output macro
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbysmith007 committed Dec 14, 2011
1 parent ff44a21 commit 09c0856
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions collectors.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(:use :cl :cl-user)
(:export
#:with-collector
#:with-collector-output
#:with-collectors
#:make-collector
#:make-pusher
Expand Down Expand Up @@ -227,6 +228,14 @@ current list of values."
(apply ,collector items)))
,@body))))

(defmacro with-collector-output ((name &key (collect-nil t) initial-value from-end)
&body body)
`(with-collector (,name :collect-nil ,collect-nil
:initial-value ,initial-value
:from-end ,from-end)
,@body
(,name)))

(defmacro with-collectors (names &body body)
"Bind multiple collectors. Each element of NAMES should be a
list as per WITH-COLLECTOR's first orgument."
Expand Down

0 comments on commit 09c0856

Please sign in to comment.