1.10. Modules

In Parallaxis, like in Modula-2, each module consists of two files: a definition module and an implementation module. The only exception is the main module, which starts a program and does not have a definition module. Parallaxis also offers a FOREIGN module, which serves as the definition part for linking routines written in another language.

The sample module constellation above shows declaration, export, and import of the user-defined procedure myproc. It is exported in the definition module together with its procedure head, showing number and type of parameters. The actual implementation of myproc is hidden in the corresponding implementation module (this is also used for including routines from different programming languages). If an export list is missing in a definition module, then its whole contents is being exported.

The module importing and using procedure myproc in the example is the main module (it has neither keyword DEFINITION nor IMPLEMENTATION).

There are two ways of importing objects. The first imports individual objects from a module, the second includes all objects from a module (in that case, however, an object name always requires the module name as a prefix, in order to avoid name conflicts):


[ Previous Page | Table of Contents | Next Page ]