Skip to content

Commit

Permalink
better documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbysmith007 committed Jul 15, 2011
1 parent 3f9e5b5 commit 70bf333
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions collectors.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ current list of values."
if you call the resultant function with no arguments, you get the
collection so far
if you call it with arguments the results of calling your function spec are
collected "
collected
(with-mapping-collector (col (x) (* 2 x))
(col 1)
(col 2)
(col 3)
(col)) => (2 4 6)
"
(alexandria:with-unique-names (col flet-args)
`(let ((,col (make-collector)))
(flet ((,name (&rest ,flet-args)
Expand All @@ -241,7 +247,13 @@ current list of values."
if you call the resultant function with no arguments, you get the
collection so far
if you call it with arguments the results of calling your function spec are
collected "
collected
(with-mapping-appender (app (l) (mapcar #'(lambda (x) (* 2 x)) l))
(app '(1 2))
(app '(2 3))
(app '(3 4))
(app)) => (2 4 4 6 6 8)
"
(alexandria:with-unique-names (col flet-args)
`(let ((,col (make-appender)))
(flet ((,name (&rest ,flet-args)
Expand All @@ -252,6 +264,7 @@ current list of values."
,@body))))

;; Copyright (c) 2002-2006, Edward Marco Baringer
;; Copyright (c) 2011, Russ Tyndall, Acceleration.net
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
Expand Down

0 comments on commit 70bf333

Please sign in to comment.