Read this entire assignment before beginning work.
Read EOPL Chapters 8 and 9 for background.
set!to the interpreter from part 1 of assignment 3. That is, support the following subset of Scheme:
e ::= n | #t | #f | () | (quote x) | x | (if e e e) | (lambda (x ...) e) | (let ((x e) ...) e) | (let* ((x e) ...) e) | (letrec ((x f) ...) e) | (set! x e) | (begin e e ...) | (e e ...)where
nis a number,
xis a variable, and
...means zero or more of the previous parenthesis-balanced item. Primitives should include
+ * - / = not eq? symbol? number? cons car cdr pair?as before. Your interpreter should be meta-circular and direct style, ie., not first-order, not CPS. But do not use Scheme's
letrec. Environments should map variables to boxes. You may start from my solution if you wish.
let/ccwith semantics as we discussed in class. (My parser has been extended if you are using it.)
dynamic-letthat interacts correctly with
let/cc. That is, using
let/ccto throw out of a
dynamic-letshould restore the old value of the binding. Capturing a continuation, throwing out from a
dynamic-let(which restores the old value), then throwing back into the
dynamic-letshould restore the temporary value.
load's other than
cs441-load's and has no syntax errors. This file should define a function
evalthat takes an expression, parses it, and evaluates it in an appropriate initial continuation. Be sure that it works with the product function from class that performs no multiplies if there is a zero in the list.