Free variables and first-class environments

A simple set of extensions to theSCHEME language removes the need for a distinguished top level interaction environment by providing first-class environments. These extensions also provide a powerful mechanism for code packaging and may be used to implement simple object-oriented systems. In addition, a mechanism is presented that implements compiled references to free variables as efficiently as in languages likeC, provided the code does not directly manipulate first-class environments. The mechanism requires a simple static analysis performed by the compiler and meshes with a slower mechanism used by both interpreted code and compiled code that manipulates first-class environments.