several typos in the vectors docs (PR10642), also some in list docs

svn: r17218
This commit is contained in:
Eli Barzilay 2009-12-06 00:15:21 +00:00
parent 7090e676fc
commit 1b5ab0b46a
2 changed files with 14 additions and 14 deletions

View File

@ -880,10 +880,10 @@ without building the intermediate list.
]} ]}
@defproc[(count [proc procedure?] [lst list?] ...+) @defproc[(count [proc procedure?] [lst list?] ...+)
list?]{ exact-nonnegative-integer?]{
Returns @scheme[(length (filter proc lst ...))], but Returns @scheme[(length (filter proc lst ...))], but without building
without building the intermediate list. the intermediate list.
@mz-examples[#:eval list-eval @mz-examples[#:eval list-eval
(count positive? '(1 -1 2 3 -2 5)) (count positive? '(1 -1 2 3 -2 5))

View File

@ -184,7 +184,7 @@ Applies @scheme[proc] to the elements of the @scheme[vec]s from the
v v
]} ]}
@defproc[(vector-append [lst list?] ...) list?]{ @defproc[(vector-append [vec vector?] ...) vector?]{
Creates a fresh vector that contains all Creates a fresh vector that contains all
of the elements of the given vectors in order. of the elements of the given vectors in order.
@ -194,19 +194,19 @@ of the elements of the given vectors in order.
} }
@defproc[(vector-take [vec vector?] [pos exact-nonnegative-integer?]) list?]{ @defproc[(vector-take [vec vector?] [pos exact-nonnegative-integer?]) vector?]{
Returns a fresh vector whose elements are the first @scheme[pos] elements of Returns a fresh vector whose elements are the first @scheme[pos] elements of
@scheme[vec]. If @scheme[vec] has fewer than @scheme[vec]. If @scheme[vec] has fewer than
@scheme[pos] elements, the @exnraise[exn:fail:contract]. @scheme[pos] elements, then the @exnraise[exn:fail:contract].
@mz-examples[#:eval vec-eval @mz-examples[#:eval vec-eval
(vector-take #(1 2 3 4) 2) (vector-take #(1 2 3 4) 2)
]} ]}
@defproc[(vector-take-right [vec vector?] [pos exact-nonnegative-integer?]) list?]{ @defproc[(vector-take-right [vec vector?] [pos exact-nonnegative-integer?]) vector?]{
Returns a fresh vector whose elements are the last @scheme[pos] elements of Returns a fresh vector whose elements are the last @scheme[pos] elements of
@scheme[vec]. If @scheme[vec] has fewer than @scheme[vec]. If @scheme[vec] has fewer than
@scheme[pos] elements, the @exnraise[exn:fail:contract]. @scheme[pos] elements, then the @exnraise[exn:fail:contract].
@mz-examples[#:eval vec-eval @mz-examples[#:eval vec-eval
(vector-take-right #(1 2 3 4) 2) (vector-take-right #(1 2 3 4) 2)
@ -215,7 +215,7 @@ Returns a fresh vector whose elements are the last @scheme[pos] elements of
@defproc[(vector-drop [vec vector?] [pos exact-nonnegative-integer?]) vector?]{ @defproc[(vector-drop [vec vector?] [pos exact-nonnegative-integer?]) vector?]{
Returns a fresh vector whose elements are the elements of @scheme[vec] Returns a fresh vector whose elements are the elements of @scheme[vec]
after the first @scheme[pos] elements. If @scheme[vec] has fewer after the first @scheme[pos] elements. If @scheme[vec] has fewer
than @scheme[pos] elements, the @exnraise[exn:fail:contract]. than @scheme[pos] elements, then the @exnraise[exn:fail:contract].
@mz-examples[#:eval vec-eval @mz-examples[#:eval vec-eval
(vector-drop #(1 2 3 4) 2) (vector-drop #(1 2 3 4) 2)
@ -224,7 +224,7 @@ Returns a fresh vector whose elements are the elements of @scheme[vec]
@defproc[(vector-drop-right [vec vector?] [pos exact-nonnegative-integer?]) vector?]{ @defproc[(vector-drop-right [vec vector?] [pos exact-nonnegative-integer?]) vector?]{
Returns a fresh vector whose elements are the elements of @scheme[vec] Returns a fresh vector whose elements are the elements of @scheme[vec]
before the first @scheme[pos] elements. If @scheme[vec] has fewer before the first @scheme[pos] elements. If @scheme[vec] has fewer
than @scheme[pos] elements, the @exnraise[exn:fail:contract]. than @scheme[pos] elements, then the @exnraise[exn:fail:contract].
@mz-examples[#:eval vec-eval @mz-examples[#:eval vec-eval
(vector-drop-right #(1 2 3 4) 2) (vector-drop-right #(1 2 3 4) 2)
@ -288,11 +288,11 @@ returns @scheme[#f].
]} ]}
@defproc[(vector-count [proc procedure?] [lst list?] ...+) @defproc[(vector-count [proc procedure?] [vec vector?] ...+)
list?]{ exact-nonnegative-integer?]{
Returns @scheme[(vector-length (vector-filter proc lst ...))], but Returns the number of elements of the @scheme[vec ...] (taken in
without building the intermediate list. parallel) on which @scheme[proc] does not evaluate to @scheme[#f].
@mz-examples[#:eval vec-eval @mz-examples[#:eval vec-eval
(vector-count even? #(1 2 3 4 5)) (vector-count even? #(1 2 3 4 5))