This root program defines a procedure that builds an environment from lists of names and values.
(code zip (vars vals r k) ((prim done null? vars) (if done ((prim p car k) (jump p k r))) (prim vars-hd car vars) (prim vals-hd car vals) (prim vars-tl cdr vars) (prim vals-tl cdr vals) (prim bind cons vars-hd vals-hd) (prim spine cons bind r) (const zip (code zip ...)) (jump zip vars-tl vals-tl spine k)) ...)
Being recursive, zip
calls itself; the value in the (const zip
(code zip ...))
instruction is a circular pointer. This avoids an
explicit recursive environment construct, or a special top-level
environment. The final ...
in the stucture hides the memo table
used by cogen.
The code is graphically represented like this:
Code structures start with a rectangle labeled with the name of the
code. Each straight list of instructions is represented with an oval.
Lists ending with an if
instruction are labeled with the name of
the tested variable, those ending with a jump
are linked with a
solid edge to the called code. If the jump target is unknown (as when
a procedure returns) then the oval is terminal.
(see envs)