CS212 Exams
Fall 1996 - Prelim 1

Evaluation of Scheme Expressions


For each of the following determine what value would be returned, or describe what error would occur.
  1. (head (tail (head (tail '(5 (2 (6 3)) 4)))))
    
  2. (((lambda (x) x) 3) 4)
    
  3. (((lambda (car cdr) (lambda (x) (if x car cdr))) 1 2) #t)
    
  4. (define (except test expr1 expr2)
            (if (not test) expr1 expr2)))
    (except #t (/ 1 0) 3)
    

Solution

Return to CS 212 Prelim 1 - Fall 1996