6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 12.1.12 Environment: a sequence of frames So here is our frame from before. with the bindings we had °B Slide 12.1.13 Environment: a sequence of frames and here is a second frame, with its own set of bindings. An Environment E1 consists of frames a and B environment is a nested sequence of frames, so environment El consists in this case of frame a followed by frame B z:10 Environment: a sequence of frames Slide 12.1.14 Environment E1 consists of frames a and B A second environment, E2, might just consist of Frame B, So Environment E2 consists of frame B only note that a frame can be shared by more than one environment A frame may be shared by multiple environments and we will see shortly why that is a powerful tool Slide 12.1.15 Environment: a sequence of frames The connection between frames is important, and is called an onsists of frames a and B enclosing environment pointer. So for example, El starts with Environment E2 consists of frame B only Frame A, and inherits Frame B as its enclosing environment, A frame may be shared by multiple environments which in fact is similar to E2 We will see shortly why all these pieces put together help us understanding exactly how z:10 evaluation is going to proceed So far, we have just been talking about details: we have frames environment pointer which are tables of bindings, we have connections between frames, and we have environments as sequences of frames With all of these pieces in mind, we can now start relating them to the actual evaluation of expressions6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 12.1.12 So here is our frame from before, with the bindings we had... Slide 12.1.13 ... and here is a second frame, with its own set of bindings. An environment is a nested sequence of frames, so environment E1 consists in this case of Frame A followed by Frame B. Slide 12.1.14 A second environment, E2, might just consist of Frame B, so note that a frame can be shared by more than one environment, and we will see shortly why that is a powerful tool. Slide 12.1.15 The connection between frames is important, and is called an enclosing environment pointer. So for example, E1 starts with Frame A, and inherits Frame B as its enclosing environment, which in fact is similar to E2. We will see shortly why all these pieces put together help us understanding exactly how evaluation is going to proceed. So far, we have just been talking about details: we have frames, which are tables of bindings, we have connections between frames, and we have environments as sequences of frames. With all of these pieces in mind, we can now start relating them to the actual evaluation of expressions