CS 217: Written Assignment #1

Assigned on Wednesday, April 17.
Due on Wednesday, April 24.

Chapter 2

Variation on Problem 4 on page 68:
Suppose that you are charged with building a Scheme interpreter in C++. Draw a modified version of Figure 2.4 on page 59 that reflects the layers of this virtual computer. What kind of C++ syntax would you use to store lists? Keep in mind what you know about how Scheme maintains its lists internally.

Variation on Problem 5 on page 68:
Consider the following C++ code:

while (x < 5)

  x++;

For each syntactic component of the above code (variable names, operation symbols, etc.), list the various bindings that are necessary to completely determine the semantics of the statement when it is executed. For each binding, identify the binding time used in the language.

Chapter 3

On textbook pages 110-112, do the following problems: #2, 5, 11a, 11b.