next up previous index
Next: Privacy Up: Module System Previous: Libraries

Other Modular Items

Operators, records, macros, arrays and global variables have only two visibility levels: global (visible from all modules that do not define a local one) or local (only visible from its definition module).

Operators can be defined globally or locally using global_op/3 or op/3. A local operator only affects the module where it is defined.

A local operator always hides a global one. Moreover, a local operator of precedence 0 can be used to hide a global operator definition of the same associativity class. It can be removed (and the global one made visible again) with abolish_op/1.

Records are global by default. A local record is declared with local_record/1 and then used normally (predicates that access records work on the visible record). A local record can be abolished (and therefore make a global visible if there is one) with abolish_record/1. Please note that erase_all/1 is different to abolish_record/1 since it only removes all the values recorded under a key but does not remove the local declaration of that record (i.e. an existing global record is not made visible).

Arrays are global or local depending on whether they are defined with make_array/1,2 or make_local_array/1,2. All built-ins that access arrays or global variables access the visible one. Any array can be removed using erase_array/1.

Macros are local by default, they can be made global if the flag global is specified in the flag list.

Character classes and syntax options are only local, they cannot be made global. If two or modules have to share them, they have to be defined in a module interface.

Metaterm attributes are accessed by a name which is usually the name of a module. Attribute names are global, they cannot be made local.



next up previous index
Next: Privacy Up: Module System Previous: Libraries



Micha Meier
Mon Mar 4 12:11:45 MET 1996