The Ada Program: madness.adb
1
2
3
4
5
6
7
8
9
10
11
12 with Ada.Text_IO, Ada.Integer_Text_IO;
13 use Ada;
14
15 procedure Madness is
16
17 package P is
18 procedure F;
19 procedure H;
20 end P;
21
22 procedure G is
23 begin
24 P.H;
25 exception
26 when others => raise;
27 end G;
28
29 package body P is
30 E : exception;
31 procedure F is
32 begin
33 G;
34 exception
35 when E => Text_IO.Put ("Got it!");
36 end F;
37 procedure H is
38 begin
39 raise E;
40 end H;
41 end P;
42
43 begin
44 P.F;
45 end Madness;