Next: , Previous: , Up: Modules   [Contents][Index]

5.12.2 Introduction on Modules

What’s modules in general? When writing a large program, it is important to break up it into separate components, or modules, and encapsulate so that undesirable interference between modules are avoided.

In Rep, modules may be anonymous or named. Each structure is a separate global namespace, with a number of variable bindings. Each closure contains a reference to the structure it was instantiated in, for accessing the bindings of any free variables referenced by that closure.

An interface of a structure declares the module’s bindings that may be accessed by other modules. Each module also lists the other modules whose bindings it may reference.

Rep’s module system is inspired by the Scheme48, Xerox Scheme and Standard ML module systems.