COM 1358 Assignment #2. Due: Tuesday, 18 April 2000 For these programming exercises, just turn in the code for your solution. Your code should be written in the functional subset of R5RS Scheme, augmented by DEFINE-DATATYPE and CASES. Your code should contain no exclamation points or i/o, and must define all procedures that are not standard in R5RS Scheme. Programming exercises: 1. Implement a procedure SELECT that takes a predicate and a list, and returns the first element of the list that satisfies the predicate, or #F if none of the elements satisfy the predicate. Examples: > (select negative? '(1 3 5)) #f > (select symbol? (list + (exp 1) 'pie 'r "round")) pie 2. Implement a procedure REDUCE-LEFT that takes a binary procedure f, an initial value x0, and a possibly empty list (x1 ... xn), and returns x0 if the list is empty, or the value obtained by calling REDUCE-LEFT on f, (f x0 x1), and the list (x2 ... xn) if the list is nonempty. Examples: > (reduce-left * 1 '(1 2 3 4 5 6 7 8 9 10)) 3628800 > (reduce-left (lambda (x y) (cons y x)) '() '(a b c d e)) (e d c b a) Exercise 2.2.1 (without using VECTOR->LIST) Exercise 2.2.2 Exercise 2.3.3 (without using REVERSE or LIST->VECTOR)