正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 12.3.6 (square 4)I In fact, we can create a nice notation to keep track of this. I can link these two pointers together, to indicate that the enclosing environment of frame A comes from the application of the indicated procedure object square >#lproc] Slide 12.3.7 Step three: take the formal parameters of the procedure object (square 4)I gE eing applied, in this case X, and bind them within that new frame to the corresponding procedure argument values, in this case 4 boy:(kxx)④ square I GE==># [pro (square 4)I gE Slide 123.8 Now, with respect to that new environment, El, evaluate the m一一 body of the procedure being applied. So notice, evaluating (square 4) with respect to one environment, has reduced to evaluating a simpler expression, ( xx), with espect to a new environment - square >#[ ( 2 *)el Slide 12.3.9 (square 4)I Now the same rules apply as before. This is a compound expression, so we need to get the values of the subexpressions ith respect to El. We start by getting the value of x with square respect to el square I ge==># [proc] 460536.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 12.3.6 In fact, we can create a nice notation to keep track of this. I can link these two pointers together, to indicate that the enclosing environment of Frame A comes from the application of the indicated procedure object. Slide 12.3.7 Step three: take the formal parameters of the procedure object being applied, in this case x, and bind them within that new frame to the corresponding procedure argument values, in this case 4. Slide 12.3.8 Now, with respect to that new environment, E1, evaluate the body of the procedure being applied. So notice, evaluating (square 4) with respect to one environment, has reduced to evaluating a simpler expression, (* x x), with respect to a new environment. Slide 12.3.9 Now the same rules apply as before. This is a compound expression, so we need to get the values of the subexpressions with respect to E1. We start by getting the value of * with respect to E1
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有