use
package_name {, package_name};
use
P;
use
P; use
P, P;
procedure
R is
package
TRAFFIC is
type
COLOR is
(RED, AMBER, GREEN);
...
end
TRAFFIC; package
WATER_COLORS is
type
COLOR is
(WHITE, RED, YELLOW, GREEN, BLUE, BROWN, BLACK);
...
end
WATER_COLORS; use
TRAFFIC; -- COLOR, RED, AMBER, and GREEN
-- are directly visible
use
WATER_COLORS; -- two homographs of GREEN are directly
-- visible but COLOR is no longer directly
-- visiblesubtype
LIGHT is
TRAFFIC.COLOR; -- Subtypes are used to resolve
subtype
SHADE is
WATER_COLORS.COLOR; -- the conflicting type
-- name COLOR
PAINT : SHADE;
begin
SIGNAL := GREEN; -- that of TRAFFIC
PAINT := GREEN; -- that of WATER_COLORS
end
R;
package
D is
T, U, V : BOOLEAN;
end
D; procedure
P is
package
E is
B, W, V : INTEGER;
end
E; procedure
Q is
T, X : REAL;
use
D, E;
begin
-- the name T means Q.T, not D.T
-- the name U means D.U
-- the name B means E.B
-- the name W means E.W
-- the name X means Q.X
-- the name V is illegal : either D.V or E.V must be used
...
end
Q;
begin
...
end
P;