next up previous index
Next: Getting Started Up: Module System Previous: Module System   Index

Subsections

Basics

Purpose of Modules

The purpose of the module system is to provide a way to package a piece of code in such a way that

In particular, this helps with

What is under Visibility Control?

The ECLiPSe module system governs the visibility of the following entities:

Predicate names
Predicates can always be used in the module where they are defined and optionally in other modules when they are made available.
Structure names
Structure declarations can be valid only local to a module or shared between several modules.
Syntax settings
These include operator declarations op/3, syntax options and character classes. This means in particular that different modules can use different language dialects (e.g. ECLiPSe vs. ISO-Prolog).
Container names
These include the names of record keys, nonlogical variables and references. They are always local to the module where they are declared7.1.
Initialization goals
These are goals that are executed when the module is loaded or imported.

Note that every definition (predicate, structure etc) is in some module, there is no space outside the modules. When you don't explicitly specify a module, you inherit the module from the context in which you do an operation. When you are using an interactive ECLiPSe toplevel, a prompt will tell you in which module your input is read and interpreted.

What Modules are There?

The module system is flat, i.e. no module is part of another module, and module names must be unique. There are


next up previous index
Next: Getting Started Up: Module System Previous: Module System   Index
Warwick Harvey
2004-08-07