From dca895c129c215a79f7a632fc230cc61877bd10b Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Thu, 9 Sep 2010 17:08:09 -0400 Subject: [PATCH] Minor edits to `for/vector' docs. --- collects/scribblings/guide/for.scrbl | 6 +++--- collects/scribblings/reference/for.scrbl | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/collects/scribblings/guide/for.scrbl b/collects/scribblings/guide/for.scrbl index d9cae23497..bdfbb9f36f 100644 --- a/collects/scribblings/guide/for.scrbl +++ b/collects/scribblings/guide/for.scrbl @@ -214,7 +214,7 @@ form normally suffices with @racket[for], a @racket[when] expression form in a @racket[for/list] would cause the result list to contain @|void-const|s instead of omitting list elements. -The @racket[for*/list] is like @racket[for*], nesting multiple +The @racket[for*/list] form is like @racket[for*], nesting multiple iterations: @interaction[ @@ -241,8 +241,8 @@ newly-constructed vector instead of a list: (string-append (number->string i) ". " chapter)) ] -The @racket[for*/vector] behaves similarly, but the iterations are -nested. +The @racket[for*/vector] form behaves similarly, but the iterations are +nested as in @racket[for*]. The @racket[for/vector] and @racket[for*/vector] forms also allow the length of the vector to be constructed to be supplied in advance. The diff --git a/collects/scribblings/reference/for.scrbl b/collects/scribblings/reference/for.scrbl index b3118883bc..2ffaf24b1c 100644 --- a/collects/scribblings/reference/for.scrbl +++ b/collects/scribblings/reference/for.scrbl @@ -86,13 +86,10 @@ expression is a list of the results in order. (error "doesn't get here")) ]} -@deftogether[( -@defform*[((for/vector (for-clause ...) body ...) - (for/vector #:length length-expr (for-clause ...) body ...))] -@defform*[((for*/vector (for-clause ...) body ...) - (for*/vector #:length length-expr (for-clause ...) body ...))])]{ +@defform*[((for/vector (for-clause ...) body ...+) + (for/vector #:length length-expr (for-clause ...) body ...+))]{ -Iterates like @scheme[for] or @scheme[for*], but the last expression +Iterates like @scheme[for], but the last expression in the @scheme[body]s must produce a single value, which is placed in the corresponding slot of a vector. If the optional @scheme[#:length] form is used, then @scheme[length-expr] must evaluate to an @@ -231,6 +228,8 @@ nested. @deftogether[( @defform[(for*/list (for-clause ...) body ...+)] @defform[(for*/lists (id ...) (for-clause ...) body ...+)] +@defform*[((for*/vector (for-clause ...) body ...+) + (for*/vector #:length length-expr (for-clause ...) body ...+))] @defform[(for*/hash (for-clause ...) body ...+)] @defform[(for*/hasheq (for-clause ...) body ...+)] @defform[(for*/hasheqv (for-clause ...) body ...+)]