#| A PR record is - (define-struct PR (name exchange profit)) A list-of-PRs is either - empty - (cons p lor) where p is a PR record and lor is a list-of-PRs. (define (LOPR-template alopr) (cond [(empty? alopr) ...] [else ... (first alopr) ... (LOPR-template (rest alopr)) ...])) ;; ^^^ a PR-record ^^^ possible natural recursion |# ;; project : list-of-PRs -> list-of-symbols ;; return the names of all PR records with profit between 10 and 20 (incl) (define (project alopr) (cond [(empty? alopr) empty] [else (cond [(okay? (first alopr)) (cons (PR-name (first alopr)) (project (rest alopr)))] [else (project (rest alopr))])])) ;; okay? : PR -> boolean ;; determine whether a-PR's profit is between 10 and 20 (incl) (define (okay? a-PR) (<= 10 (PR-profit a-PR) 20))