(guile.info.gz) Modules
Info Catalog
(guile.info.gz) Objects
(guile.info.gz) Top
(guile.info.gz) Scheduling
31 Modules
**********
When programs become large, naming conflicts can occur when a function
or global variable defined in one file has the same name as a function
or global variable in another file. Even just a _similarity_ between
function names can cause hard-to-find bugs, since a programmer might
type the wrong function name.
The approach used to tackle this problem is called _information
encapsulation_, which consists of packaging functional units into a
given name space that is clearly separated from other name spaces.
The language features that allow this are usually called _the module
system_ because programs are broken up into modules that are compiled
separately (or loaded separately in an interpreter).
Older languages, like C, have limited support for name space
manipulation and protection. In C a variable or function is public by
default, and can be made local to a module with the `static' keyword.
But you cannot reference public variables and functions from another
module with different names.
More advanced module systems have become a common feature in recently
designed languages: ML, Python, Perl, and Modula 3 all allow the
_renaming_ of objects from a foreign module, so they will not clutter
the global name space.
In addition, Guile offers variables as first-class objects. They can
be used for interacting with the module system.
Menu
* provide and require The SLIB feature mechanism.
* Environments R5RS top-level environments.
* The Guile module system How Guile does it.
* Dynamic Libraries Loading libraries of compiled code at run time.
* Variables First-class variables.
Info Catalog
(guile.info.gz) Objects
(guile.info.gz) Top
(guile.info.gz) Scheduling
automatically generated byinfo2html