CS G111 Machine Problem 5b:
Manipulating the Store
Out: October 23, 2007
Due: October 30, 2007
Mail messages related to this assignment will be archived here. FAQs for this assignment are collected here. You should check this archive before
asking a question.
For this problem, you will extend the language IMPLICIT-REFS, found at
/course/csg111/interps/lecture05/implicit-refs.
Do the following exercises:
- Add multiple-argument procedures and multiple-declaration
let-expressions to IMPLICIT-REFS. No rules required
for this one. [10 points]
- Write a rule for let in IMPLICIT-REFS, in the style
of the rules on page 21 of the notes. You may use either the
"rule" style or the "equation" style. Write this as a comment
to the appropriate line of the interpreter. [2 points]
You should submit a single set of files for questions 1 and 2.
In these files, use the test harness
drscheme-init.scm, as usual. Your top-level file
should be named top-implicit-refs.scm.
- Implement the statement language given in the notes. The
interpreter on page 36 of the notes is available at
/course/csg111/interps/mp5/statements.scm.
The expressions of your statement language should be the
expressions of question 1. [10 points]
- Add while to the statement language. Write a rule or rules
in the style of the rules on page 35 of the notes [3 points],
and implement them [5 points]. As in question 2, you may use
either the "rule" style or the "equation" style.
You should submit a single set of files for questions 3 and 4.
The top-level file should be named
top-statements.scm. This set of files can, but need
not, be disjoint from the files for questions 1 and 2.
Further notes on questions 3 and 4:
-
Use the grammar in the book (Exercise 4.22), not the one in the notes.
They differ in the syntax for print, and that the one in
the book also has a while statement (which is needed for
question 4 of this MP).
-
For questions 3 and 4, we will use a new test setup for this
problem that will capture the values that your interpreter
prints out.
To use this setup, the modules in these files should require
/course/csg111/interps/mp5/drscheme-mp5-init.scm
instead of drscheme-init.scm.
The implementation of print in
statements.scm communicates these values to the test
harness by calling
logged:printf instead of eopl:printf. You
shouldn't need to make any other changes in your interpreter to
accomodate this setup.
-
The beginnings of a test suite are in
/course/csg111/interps/mp5/tests.scm.
You will need to add more tests in this file.
- The code in statements.scm is untested
(sorry!), so it may contain bugs.
Last modified: Tue Feb 27 15:28:34 EST 2007