From 63b1f0f4aaed136c051e47bbb80bf3bfa35dee9e Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 7 Aug 2015 15:32:30 -0500 Subject: [PATCH] Improve docs for the new bits of `racket/sequence`. --- .../scribblings/reference/sequences.scrbl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/sequences.scrbl b/pkgs/racket-doc/scribblings/reference/sequences.scrbl index ba5e9c37a7..8cbaa0ff4d 100644 --- a/pkgs/racket-doc/scribblings/reference/sequences.scrbl +++ b/pkgs/racket-doc/scribblings/reference/sequences.scrbl @@ -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)