Improve docs for the new bits of racket/sequence.

This commit is contained in:
Vincent St-Amour 2015-08-07 15:32:30 -05:00
parent f4f75f2740
commit 63b1f0f4aa

View File

@ -783,7 +783,9 @@ If @racket[min-count] is a number, the stream is required to have at least that
@subsubsection{Additional Sequence Constructors}
@defproc[(in-syntax [stx syntax?]) sequence?]{
Produces a sequence equivalent to @racket[(syntax->list lst)].
Produces a sequence whose elements are the successive subparts of
@racket[stx].
Equivalent to @racket[(syntax->list lst)].
@speed[in-syntax "syntax"]
@examples[#:eval sequence-evaluator
@ -791,14 +793,20 @@ Produces a sequence equivalent to @racket[(syntax->list lst)].
x)]}
@defproc[(in-pairs [seq sequence?]) sequence?]{
Produces a sequence equivalent to
Produces a 2-valued sequence whose pairs of elements are the successive
@racket[car]s and @racket[cdr]s of the elements of @racket[seq].
Equivalent to
@racket[(in-parallel (sequence-lift car seq) (sequence-lift cdr seq))].
@examples[#:eval sequence-evaluator
(for/list ([(a b) (in-pairs '((1 . a) (2 . b) (3 . c)))]) b)
]
}
@defproc[(in-slice [length exact-positive-integer?] [seq sequence?])
sequence?]{
Returns a sequence where each element is a list with @racket[length]
elements from the given sequence.
Returns a sequence whose elements are lists with the first @racket[length]
elements of @racket[seq], then the next @racket[length] and so on.
@examples[#:eval sequence-evaluator
(for/list ([e (in-slice 3 (in-range 8))]) e)