Lab Quiz, Foundations of Computing, Week 4 -- Oct 17, 2000

Name:


Given these definitions:

(define x 1)

(define (add-x y)
  (+ x y))

(define (dbl-x x)
  (+ x x))

(define (add-sum y)
  (let ((sum (add-x x)))
    (+ sum y)))

(define (add-list y)
  (every add-x y))

For each of the following expressions, if the expression can be evaluated, write its value. If the expression cannot be evaluated, explain why not.

  1. 1
  2. x
  3. 'x
  4. y
  5. 'y
  6. (x)
  7. '(x)
  8. ('x)
  9. (add-x 1)
  10. (add-x x)
  11. (add-x 'x)
  12. (dbl-x 1)
  13. (dbl-x x)
  14. (dbl-x 2)
  15. (add-sum 1)
  16. (add-list (1 2 3))
  17. (add-list '(1 2 3))
  18. (add-x '(1 2 3))
  19. (keep even? (add-list '(1 2 3)))