CS212 Exams
Spring 1999 - Prelim 1

Substitution Model


In each of the following questions, you are asked to write a definition for zardoz that will make the following expression evaluate to 42. (Assume that your definition of zardoz is run first.) If you cannot force the expression to evaluate to 42, then explain why. No definition should take more than 1-3 lines of code.

  1. (head zardoz)
  2. (head 'zardoz)
  3. ((zardoz) zardoz)
  4. (((zardoz)) 3)
  5. (and zardoz (zardoz))
  6. (let ((zardoz 3)) zardoz)

Solution

Return to CS 212 Prelim 1 - Spring 1999