Improve docs for the new bits of racket/sequence
.
This commit is contained in:
parent
f4f75f2740
commit
63b1f0f4aa
|
@ -783,22 +783,30 @@ 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)].
|
||||
@speed[in-syntax "syntax"]
|
||||
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
|
||||
(for/list ([x (in-syntax #'(1 2 3))])
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user