with TEXT_IO; use TEXT_IO; procedure recursive_propagate is package int_io is new integer_io (integer); use int_io; zork: exception; procedure fred(n: integer) is begin put("entering procedure fred -- n = "); put(n, width=>2); new_line; if n=5 then raise zork; end if; put("leaving procedure fred -- n = "); put(n, width=>2); new_line; end fred; procedure recurse(j: integer) is begin new_line; put("entering procedure recurse -- j = "); put(j, width=>2); new_line; fred(j); if j<10 then recurse(j+1); end if; put("leaving procedure recurse -- j = "); put(j, width=>2); new_line; exception when zork => put("handling the zork exception in recurse ... j = "); put(j, width=>2); new_line; raise zork; end recurse; procedure test1 is begin new_line; new_line; put("entering procedure test1"); new_line; fred(5); put("I never get here"); new_line; exception when zork => put("handling the zork exception in test1"); new_line; end test1; procedure test2(m: integer) is begin new_line; new_line; put("entering procedure test2"); new_line; recurse(m); put("done with test2"); new_line; exception when zork => put("handling the zork exception in test2"); new_line; end test2; begin -- main program here test1; test2(7); test2(1); recurse(2); put("end of main program"); new_line; exception when zork => put("handling the zork exception in main program"); new_line; end recursive_propagate;