Skip to content

Commit

Permalink
added a with-string-builder-output macro that outputs the string as t…
Browse files Browse the repository at this point in the history
…he result of the form
  • Loading branch information
bobbysmith007 committed Jul 15, 2011
1 parent 80408c4 commit 3f9e5b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions collectors.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#:with-appender
#:make-appender
#:with-string-builder
#:with-string-builder-output
#:make-string-builder
#:with-mapping-collector
#:with-mapping-appender
Expand Down Expand Up @@ -63,6 +64,15 @@
(flet ((,name (&rest items) (apply ,it items)))
,@body))))

(defmacro with-string-builder-output ((name &key delimiter (ignore-empty-strings-and-nil t))
&body body)
"A macro that creates a string builder with name in scope during the
duration of the env, the form returns the string that is built"
`(with-string-builder (,name :delimiter ,delimiter
:ignore-empty-strings-and-nil ,ignore-empty-strings-and-nil)
,@body
(,name)))

;;;; * Reducing and Collecting

;;;; ** Reducing
Expand Down

0 comments on commit 3f9e5b5

Please sign in to comment.