Assignment 4

CS 152
due April 26, 1999
100 points

Redo Assignment 1, using Scheme. You may put all of the definitions in a single file. The test cases are given in the file a4test.drs, available at the class web site.

Note that in Lisp you can assume (and the test cases do assume) that slot names and variable names are simply Lisp identifiers. The values will still be integers. If a search fails, return #f

You will need to provide definitions for the functions add-identifier, add-binding, make-binding, get-filler-dynamic, get-filler-static, make-frame, pop-frame, and push-frame. You may want to have functions creating empty environments, binding lists, and identifier lists, or identifiers bound to the appropriate values. The test cases assume that the identifier empty-environment is bound to an appropriate value. The functions define, load, newline, set!, and print are provided by Scheme.

It is a good idea to structure your code in terms of abstract data types with explicit selectors, constructors, and perhaps mutators. You may also want to define predicates such as empty-environment?

.