正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 12.3.2 (square 4)I This is a compound expression, so first we have to get the values of the subexpressions with respect to the same environment. 4 is easy to evaluate, it's just 4. We also need to get the value of s quare with respect to the global environment square G Slide 12.3.3 and that just comes from applying the name rule We look (square 4)I gE up the binding for square in this environment, and it simply points to that double bubble as shown. square I GE==># [pro (square 4)I gE Slide 12.3. 4 Aha! We are applying a procedure, one of those double m一- bubbles, to a set of arguments, so our four-step rule now comes into play. Step one: create a new frame, lets call it A ” square >#[pr。c] 4 Slide 12.3.5 (square 4)I gg Step two: convert that frame into an environment, by having its enclosing environment pointer point to the same environment as the environment pointer of the procedure object square 600Sc6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 12.3.2 This is a compound expression, so first we have to get the values of the subexpressions with respect to the same environment. 4 is easy to evaluate, it's just 4. We also need to get the value of square with respect to the global environment. Slide 12.3.3 ... and that just comes from applying the name rule. We look up the binding for square in this environment, and it simply points to that double bubble as shown. Slide 12.3.4 Aha! We are applying a procedure, one of those double bubbles, to a set of arguments, so our four-step rule now comes into play. Step one: create a new frame, lets call it A. Slide 12.3.5 Step two: convert that frame into an environment, by having its enclosing environment pointer point to the same environment as the environment pointer of the procedure object
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有