CS200: Computer Science, Spring 2002
Notes: Monday 4 March 2002
- Before doing PS5, you should read SICP, through 3.3.2 (p. 217-261). Sorry I forgot to put the Notes Wednesday or on PS5.
- Lab hours for PS5: Monday, 8-9:30pm
- Friday, 8 March: Problem Set 5
- 9-17 March: Spring Break
- Before 18 March: GEB all of Part I
Places, Frames and Envrionments
Compound Application Rule
- Names identify places. (define x expr) and (lambda (x) expr) both create places named x.
- Frames hold names. All names must be inside a frame.
- An environment is a pointer to a frame.
- All frames except the outermost frame have pointers to a parent frame.
- The global environment is a pointer to the outermost frame. The outermost frame contains all the Scheme primitives.
Why must expressions be evaluated in an environment?
- Construct a new frame, enclosed in the environment of this procedure (that is, the parent of this frame is the frame this procedure's environment points to)
- Make places in that frame with the names of each parameter
- Put the values of the parameters in those places
- Evaluate the body in the new environment
How do we find the value associated with a name in an environment?
CS655 Problem Set [Answers]
PhD Qualifying Exam
University of Virginia
Department of Computer Science
CS 200: Computer Science
Using these Materials