diff --git a/pkgs/racket-doc/scribblings/guide/lists.scrbl b/pkgs/racket-doc/scribblings/guide/lists.scrbl index c7bb8f1bac..663031eadc 100644 --- a/pkgs/racket-doc/scribblings/guide/lists.scrbl +++ b/pkgs/racket-doc/scribblings/guide/lists.scrbl @@ -74,15 +74,7 @@ by @racket[and]ing or @racket[or]ing: (ormap number? (list "a" "b" 6)) ] -The @racket[filter] function keeps elements for which the body result -is true, and discards elements for which it is @racket[#f]: - -@interaction[ -(filter string? (list "a" "b" 6)) -(filter positive? (list 1 -2 6 7 0)) -] - -The @racket[map], @racket[andmap], @racket[ormap], and @racket[filter] +The @racket[map], @racket[andmap], and @racket[ormap] functions can all handle multiple lists, instead of just a single list. The lists must all have the same length, and the given function must accept one argument for each list: @@ -93,6 +85,14 @@ must accept one argument for each list: (list 6 3 7)) ] +The @racket[filter] function keeps elements for which the body result +is true, and discards elements for which it is @racket[#f]: + +@interaction[ +(filter string? (list "a" "b" 6)) +(filter positive? (list 1 -2 6 7 0)) +] + The @racket[foldl] function generalizes some iteration functions. It uses the per-element function to both process an element and combine it with the ``current'' value, so the per-element function takes an