Fix discussion of filter.

Closes PR 15083.
This commit is contained in:
Vincent St-Amour 2016-01-01 12:44:12 -06:00
parent 110f1bd9b0
commit 4c04d4afce

View File

@ -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