next up previous contents
Next: USE ONLY Statement Up: Modules Previous: Encapsulation - Stack example

 

The USE Renames Facility

 

The USE statement names a module whose public definitions are to be made accessible. It has the following form:

 
USE  tex2html_wrap_inline21746  module-name  tex2html_wrap_inline21748  [, tex2html_wrap_inline21746  new-name  tex2html_wrap_inline21748  =>  tex2html_wrap_inline21746  use-name  tex2html_wrap_inline21748 ...]

If a local entity has the same name as an object in the module, then the module object can be renamed, (as many renames as desired can be made in one USE statement, they are just supplied as a comma separated list),

    USE HOUSE_DEFS, GET_HOME=>GET_HOUSE

Here the module object GET_HOUSE is renamed to GET_HOME when used locally. This renaming facility is essential otherwise user programs would often require rewriting due to name clashes, in this way the renaming can be done by the compiler. Renaming should not be used unless absolutely necessary as it can add a certain amount of confusion to the program. It is only permissible to rename an object once in a particular scoping unit.


next up previous contents
Next: USE ONLY Statement Up: Modules Previous: Encapsulation - Stack example

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996
Not for commercial use.