CS 217: Written Assignment #1

Assigned on Wednesday, 1/19.
Due on Wednesday, 1/26 at the beginning of class.

Chapter 2

Variation on Problem 4 on page 68:
Suppose that you are charged with building a Scheme interpreter in Java or C++ (your choice, but make sure to indicate which you are doing). Draw a modified version of Figure 2.4 on page 59 that reflects the layers of this virtual computer. Sketch the basic idea of how you would construct a class in Java or C++ to handle a Scheme list. Keep in mind what you know about how Scheme maintains its lists internally.

Variation on Problem 5 on page 68:
Consider the following Java/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. Consider the various binding times listed on page 61 of your textbook, and make sure to indicate which language you have chosen to use (Java or C++).

Chapter 3

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