Essentials of Programming Languages (EOPL): Section 4.3.
You may work singly or in pairs on this assignment.
Be sure you mark (via comments) each change you make
to the interpreter files.
(See the Homework Policy
for more details.)
A copy of the source code of each file modified.
DO NOT turn in the source code from files you did not modify.
A run of your code that verifies that it passes all the tests in your test harness.
If you have more than one file to submit, bundle them into a zip or tar archive.
Click on
this
electronic-submission link,
and use your NetID and password for authorization.
Important: Make sure you select CIS 352 as the course
for which you're submitting.
Do only one of the following options. If you choose option B, we will offer advice, but no hand holding.
(30 points) EOPL Exercise 4.17
(35 points) EOPL Exercise 4.19
(35 points) EOPL Exercise 4.21
(120 points) EOPL Exercise 4.22
Part of the
point of this problem is for you to make a design decisions on
your own. In particular, the authors leave it up to you
what goes into the expression language. At the very
least, you must have the problem's four examples working.
Remember that map is your friend and
extend-env* is a good thing to have.
For Exercise 4.19:
even/odd
example of Figure 4.7. What your modified interpreter
would do on this letrec would be
equivalent to:
let even = 0
odd = 0
in begin
set even = proc(dummy) ...;
set odd = proc(dummy) ...;
the body of the letrec
end
extend-env-rec* cesses being
a data-structure (i.e., you remove it from the
environment data-type) and turns it
into a regular function that builds the proper
environment to evaluate the body of
the letrec.
instrument-let tracing, you now have circular
structures!
For Exercise 4.21:
value-of.
For Exercise 4.22: