From 4a3b8cdfc4eb7d7e99fff081fc9d9e37461ef611 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Fri, 17 May 2013 00:21:54 -0400 Subject: [PATCH] Add examples for `for/lists` --- collects/scribblings/reference/for.scrbl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/collects/scribblings/reference/for.scrbl b/collects/scribblings/reference/for.scrbl index ee5651b68e..a19e1aa681 100644 --- a/collects/scribblings/reference/for.scrbl +++ b/collects/scribblings/reference/for.scrbl @@ -253,7 +253,20 @@ Similar to @racket[for/list], but the last @racket[body] expression should produce as many values as given @racket[id]s, and the result is as many lists as supplied @racket[id]s. The @racket[id]s are bound to the lists accumulated so far in the @racket[for-clause]s and -@racket[body]s.} +@racket[body]s. + +@examples[ +(for/lists (l1 l2 l3) + ([i '(1 2 3)] + [j "abc"] + #:when (odd? i) + [k #(#t #f)]) + (values i j k)) +(for/lists (acc) + ([x '(tvp tofu seitan tvp tofu)] + #:unless (member x acc)) + x) +]} @defform[(for/first (for-clause ...) body-or-break ... body)]{ Iterates like