7.3.6 B: ACI
7.3.6.1 Introduction
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.
7.3.6.2 Language
You will define a macro, aci, that takes an expression and returns the same expression converted to ACI-form.
primitive values (numbers)
variables
function application (of one argument)
lambda (of one argument)
set!
begin, with two sub-terms
+ and ++, both of two arguments
7.3.6.3 Web Extension
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.