An import specifies a program that is to be imported and run together with another program.
- Program identification
A program is identified with three pieces of information:
The prefix is a string that is added to all functions and data structures of the imported program.
For example, if the prefix is
gl then the imported functions,
Close are renamed
The reason the prefix is needed is that functions and data structures of two programs might be named the same thing. For example, two data structures might be called
Part, or two functions might be called
Programs have namespaces, but the name spaces are not used in the program text to differentiate functions or data structures.
An import has a list of functions are used in the importing program. This list is generated automatically from the importing program text.
It is the functions of the imported programs that are available. The imports of the imports will also be imported, but in order for their functions to be avaialble, they must be imported directly, and not only indirectly.