In this assignment you will implement the ACI (Automatic Callback Insertion) transformation we have discussed in class. Since this is a program transformation, you will implement it using macros (define-syntax and syntax-rules).
After doing so, you will extend and use it to simulate a multi-tab/window Web interaction, to see the effects we have discussed in class.
You will define a macro, aci, that takes an expression and returns the same expression converted to ACI-form.
primitive values (numbers)
function application (of one argument)
lambda (of one argument)
begin, with two sub-terms
+ and ++, both of two arguments
web-read, which takes a string; it prints the string, then halts the program entirely using error (having, of course, first stashed the continuation)
restore, which takes two parameters: a tab number and a value. This restores that tab’s computation with the supplied value.
clone, which takes a single number representing which tab to clone. It returns a fresh tab number. This fresh tab has (for now) the same continuation as the tab that was cloned.
Also implement reset-tabs, which (if necessary) resets any temporary variables you set for yourself to keep track of tab numbers and/or restoration points. We will be running it in-between tests so that tabs set in previous tests do not interfere with later tests, i.e., there’s a pristine “browser” environment between tests.