SICP Note Chapter 1
1. S ubstitution model 代换模型( https://mitpress.mit.edu/sicp/full-text/sicp/book/node10.html ) 并不指实际中使用的,而是用于方便理解的一个较为粗糙的syntax analysis模型 其中代换分为正则序代换(normal-order evaluation, 把所有procedure 展开成基本运算符 最后运算) 以及应用序代换(applicative-order evaluation 先计算最外层procedure里的运算数的值 然后再展开procedure) 2. S ICP里对递归和迭代的解释 递归: (define (factorial n) (if (= n 1) 1 (* n (factorial (- n 1))))) 迭代: (define (factorial n) (fact-iter 1 1 n)) (define (fact-iter product counter max-count) (if (> counter max-count) product (fact-iter (* counter product) (+ counter 1) max-count))) This type of process, characterized by a chain of deferred operations, is called a recursive process. Carrying out this process requires that the interpreter keep track of the operations to be performed later on. In the computation of n!, the length of the chain of deferred multiplications, and hence the amount of information needed to keep track of it, grows linearly with n (is propo