next up previous contents
Next: Parametrised Intrinsic Types Up: Modules Previous: The USE Renames Facility

 

USE ONLY Statement

Another way to avoid name clashes is to only use those objects which are necessary. It has the following form:

 
USE < module-name > [ ONLY:< only-list >...]

The < only-list > can also contain renames (=>).

For example,

    USE Stack, ONLY:pos, &
           IntegerPop => Pop
Only pos and Pop are made accessible. Pop is renamed to IntegerPop.

The ONLY statement gives the compiler the option of including only those entities specifically named.

For more information, click here gif

Now try this question gif


next up previous contents
Next: Parametrised Intrinsic Types Up: Modules Previous: The USE Renames Facility

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.