CS212 Exams
Spring 1999 - Prelim 1

Solution to Substitution Model

WARNING: You should seriously try to answer this question before looking at the solution -- it's just a good study skill. Also, some answers on this page may be more brief than you would want to put down in an actual exam. If you want any type of partial credit, you should write more than just the solution.


  1. (define zardoz (list 42))
  2. Not possible for expression to evaluate to 42. quote leaves zardoz unevaluated, and head will yield an error since 'zardoz does not evaluate to a <pair>.

  3. (define (zardoz)
      (lambda (x) 42))
  4. (define (zardoz)
      (lambda ()
        (lambda (x) (* x 14))))
  5. (define (zardoz) 42)
  6. Not possible for expression to evaluate to 42. let statement shadows global definition of zardoz.

Question

Return to CS 212 Prelim 1 - Spring 1999