正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 12.4.16 (ca)I gg The value of ca is still the same procedure, and since we are applying a procedure, we use our four step rule. We drop a make-counter: frame Q n:81 b: (lambda ( (+n1) : (set! n ( n 1))n Slide 12.4.17 We then scope it with the same environment pointer as the (ca)I G rocedure object being applied, thus el as we did before make-counter (set! n ( n 1))n Slide 12.4.18 There are no parameters to bind in this frame make-counter: empty b: (set! n ( n 1))n Slide 12.4.19 o evaluating(ca) with respect to the global environment reduces to evaluating the body, (set! n ( n 1))g 4 make-counter with respect to this new frame E3 b: (lambda ( +n1}) empty (+n1})n (set! n (+n 1))Ir600: SICP6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 12.4.16 The value of ca is still the same procedure, and since we are applying a procedure, we use our four step rule. We drop a frame. Slide 12.4.17 We then scope it with the same environment pointer as the procedure object being applied, thus E1 as we did before. Slide 12.4.18 There are no parameters to bind in this frame. Slide 12.4.19 So evaluating (ca) with respect to the global environment reduces to evaluating the body, (set! n (+ n 1)) with respect to this new frame E3
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有