Homework #2Assigned: January 21
Due: January 28, 4:30pm, in class
- (5 points) [EOPL] exercise 1.16 (only part 4)
on p. 26.
- (5 points) Define a Scheme function
applytoall which accepts two arguments, a
function and a list, applies the function to every
element of the list, and returns a list of the
results.
Examples:
> (applytoall (lambda (x) (list x x)) '(oh my))
((oh oh) (my my))
> (applytoall (lambda (x) (* x x)) '(1 2 3 4 5 6))
(1 4 9 16 25 36)
- (5+15+5=25 points) [EOPL] exercise 1.17 (parts
1, 2, & 3) on p. 27.
- (10+10=20 points) [EOPL] exercise 1.18 (only
parts 1 & 2) on p. 27.
|