(1) to iterate: to apply an action to each item in a piece of
compound data
(2) studying lambda: writing actions is easy with
lambda
;; build-list: N ( N → X) → (listofX);; to construct (list (f0) ... (f (-n1)))
(define (build-listnf) ...)
;; filter: (X → boolean) (listofX) → (listofX);; to construct a list from all those items on alox for which p holds
(define (filterpalox) ...)
;; map: (X → Y) (listofX) → (listofY);; to construct a list by applying f to each item on alox;; that is, (mapf (listx-1 ... x-n)) = (list (fx-1) ... (fx-n))
(define (mapfalox) ...)
;; andmap: (X → boolean) (listofX) → boolean;; to determine whether p holds for every item on alox;; that is, (andmapp (listx-1 ... x-n)) = (and (px-1) (and ... (px-n)))
(define (andmappalox) ...)
;; ormap: (X → boolean) (listofX) → boolean;; to determine whether p holds for at least one item on alox;; that is, (ormapp (listx-1 ... x-n)) = (or (px-1) (or ... (px-n)))
(define (ormappalox) ...)