Section 1.3 - Use Clauses
Some programs might be very wordy if you had to always specify
where a procedure is defined in order to use it.
Thus, Ada provides the use clause.
Whenever you use a procedure (or something else) but do not specify
where it is defined, the Ada compiler will search all units
listed in applicable use clauses.
Use clauses follow the with clause,
begin with the keyword use,
and then list the library units to be searched.
Here's how that first program would look with a use clause:
Quiz:
If, in this new version of the program, you changed the second-to-last-line
back to:
Ada.Text_IO.Put_Line("Hello, world!");
would the program still work?
- Yes
- No
You may also:
David A. Wheeler (dwheeler@ida.org)