GNU Info

Info Node: (librep.info)Modules

(librep.info)Modules


Next: Control Structures Prev: Definitions Up: The language
Enter node , (file) or (file)node

Modules
=======

   When creating large programs from many separate components, it is
important to be able to encapsulate these components, such that the
interfaces they present to other components are well defined, and the
implementations of these interfaces may be modified without affecting
any other components. To this end `rep' provides a "module system" for
managing the scope of global definitions. This module system was
inspired by the Scheme48, Xerox Scheme and Standard ML module systems.

   Modules are known as "structures" and may be anonymous or named.
Each structure specifies and implements an "interface", essentially a
list of names listing the definitions within that module that may be
accessed by other modules. 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.

   As well as specifying its name and interface, each module also lists
the other modules whose bindings it may reference. Structures may
either "open" or "access" other structures; when opening a structure
all its exported bindings are immediately referenceable from the
importing module. Exported bindings from accessed structures are
referenced using the `structure-ref' form.

Module Interfaces
Module Definition
Module Loading
Modules and Special Variables

automatically generated by info2www version 1.2.2.9