In The Structure and Interpretation of Computer Programs part 3.2, an "environment" is defined as "a sequence of frames." But as far as I can see, the book doesn't further discuss the difference between an environment and a frame. Also, I suspect the drawings of environments conflates them with frames because books drawings are small and 2-D, and don't readily show time-evolution short of another full drawing.
So would it be correct to think of an environment at creation as being the same as its first frame? And then when any change occurs in the environment (an extant binding changed, a new binding created), the environment adds a new frame to its sequence of frames? If that understanding is NOT correct, then what exactly is the difference between an environment and a frame?
Thanks in advance for any help!
The sequence of frames is the linked list (of frames) pointing 'upwards' towards the global environment. So when an environment is created (for example, in the context of a procedure binding), the 'environment' is a pointer to the frame...which in term points to the enclosing environment (or null, if the global environment).
So ... a qualified 'yes'...it's the first frame in the sense that the rest of the environment is accessible from that first frame.
Does that help?
Cordially, Dak
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With