next up previous contents index
Next: Unbound and unassigned variables. Up: Gunk Scheme vs. ordinary Previous: Gunk Scheme vs. ordinary

Global environment.

Each gunk processor runs the program in its own top level environment. Thus each processor potentially has different values for its global variables.

As a convenience feature, variables that are not defined by the gunk program are `defaulted' from the user's environment. This allows gunk programs to use standard procedures like +, length and equal?.

However, it should be noted that defaulted procedures are assumed to behave like primitives, that is, they take very little time to execute. For some simulations this might be an important consideration, in which case the procedure can be added to the gunk code for more rigourous simulation. A warning is printed the first time a global value is used.

The defaulting process does not work properly with higher order procedure like map and for-each because the procedure that you might pass out has additional arguments used by the simulator. You have to write your own version of these proceduresgif.



Erik Rauch
Sat May 8 16:42:57 EDT 1999