Minor edits to `for/vector' docs.

This commit is contained in:
Sam Tobin-Hochstadt 2010-09-09 17:08:09 -04:00
parent 81b1ed6e8b
commit dca895c129
2 changed files with 8 additions and 9 deletions

View File

@ -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 form in a @racket[for/list] would cause the result list to contain
@|void-const|s instead of omitting list elements. @|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: iterations:
@interaction[ @interaction[
@ -241,8 +241,8 @@ newly-constructed vector instead of a list:
(string-append (number->string i) ". " chapter)) (string-append (number->string i) ". " chapter))
] ]
The @racket[for*/vector] behaves similarly, but the iterations are The @racket[for*/vector] form behaves similarly, but the iterations are
nested. nested as in @racket[for*].
The @racket[for/vector] and @racket[for*/vector] forms also allow the 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 length of the vector to be constructed to be supplied in advance. The

View File

@ -86,13 +86,10 @@ expression is a list of the results in order.
(error "doesn't get here")) (error "doesn't get here"))
]} ]}
@deftogether[( @defform*[((for/vector (for-clause ...) body ...+)
@defform*[((for/vector (for-clause ...) body ...) (for/vector #:length length-expr (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 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] the corresponding slot of a vector. If the optional @scheme[#:length]
form is used, then @scheme[length-expr] must evaluate to an form is used, then @scheme[length-expr] must evaluate to an
@ -231,6 +228,8 @@ nested.
@deftogether[( @deftogether[(
@defform[(for*/list (for-clause ...) body ...+)] @defform[(for*/list (for-clause ...) body ...+)]
@defform[(for*/lists (id ...) (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*/hash (for-clause ...) body ...+)]
@defform[(for*/hasheq (for-clause ...) body ...+)] @defform[(for*/hasheq (for-clause ...) body ...+)]
@defform[(for*/hasheqv (for-clause ...) body ...+)] @defform[(for*/hasheqv (for-clause ...) body ...+)]