SICP 全笔记

Exercise 1.34. Suppose we define the procedure

(define (f g)
  (g 2))

Then we have

(f square)
4

(f (lambda (z) (* z (+ z 1))))
6

What happens if we (perversely) ask the interpreter to evaluate the combination (f f)? Explain.

我们使用代换模型来解释 (f f)

(f f)
(f 2)
(2 2) ;=> 2 is not applicable

最后 2 将被放到过程调用的过程名的位置。