Quiz 7, CS 257

CIRT user-id:________________________
As an adolescent I aspired to lasting fame, I craved factual certainty, and I thirsted for a meaningful vision of human life - so I became a scientist. This is like becoming an archbishop so you can meet girls.
- Matt Cartmill

  1. Fill in the table (2 points each)
    what you type what Scheme prints
    `((+ 1 2) ,(+ 1 2) 4)  
    (cons '(a b) '(c (d) e))  
    (append '((a b) (c d)) '(e f))  
    (car ''a)  
    (if 1 2 3)  

  2. Define rev-noah, a function that takes two lists with an equal number of elements, packs them up two-by-two, and returns them in reverse order:
    (rev-noah '(a b c) (d e f))      ; ((c f) (b e) (a d))
    (rev-noah '() '())               ; ()
    Your definition should work (7 points) and be tail recursive (3 points).