正在加载图片...
6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 12.3. 25 To complete this evaluation, we need to get the value of Example contd: (square y)Ie (square y) with respect to El, and here is a clean tnc-square version of the environment structure developed so far (square y)) 0:31 EXample cont'd: (square y)E Slide 12.3. 26 Well, let's do it in steps. We first get the values of each of the csquare: subexpressions, now with respect to El. First, what is the value of s quare with respect to El? This is a little different than last time. We start in El. Since there is no binding for square there, we go up the environment chain to the global P: Y b:(*xx}b:(+1 environment, where we find the binding, and thus return (square y)) 6001 9ICP Slide 12.3.27 Example contd: (square y)Ie the appropriate procedure 1 (square y)) square n => #[compoundI Example contd: (square y)Ig Slide 12.3. 28 The second subexpression is y and we need its value with respect to El (square y)) square n=> #[compound] yE 1001 iCP6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 12.3.25 To complete this evaluation, we need to get the value of (square y) with respect to E1, and here is a clean version of the environment structure developed so far. Slide 12.3.26 Well, let's do it in steps. We first get the values of each of the subexpressions, now with respect to E1. First, what is the value of square with respect to E1? This is a little different than last time. We start in E1. Since there is no binding for square there, we go up the environment chain to the global environment, where we find the binding, and thus return ... Slide 12.3.27 ... the appropriate procedure. Slide 12.3.28 The second subexpression is y and we need its value with respect to E1
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有