[comp.lang.ada] Is There Anything "Wrong" With This Code?

eberard@bse.com (Edward V. Berard) (08/07/90)

Folks,

Does anything bother you about the following section of code? Specifically,
can you think of any exceptions which might be raised, and the specific
circumstances which will cause them to be raised?     

		DECLARE -- (D2)

          PROCEDURE P2D (I1, I2 : INTEGER) IS
               
               TYPE A1 IS ARRAY (1..2,1..2) OF INTEGER RANGE I1..I2;

               PROCEDURE P2D1 (A : A1 := (3..4 => (1,2))) IS
               BEGIN
                    FAILED ("BODY OF P2D1 EXECUTED");
               EXCEPTION
                    WHEN OTHERS =>
                         FAILED ("EXCEPTION RAISED IN P2D1");
               END P2D1;

          BEGIN
               P2D1;
          EXCEPTION
               WHEN CONSTRAINT_ERROR =>
                    NULL;
               WHEN OTHERS =>
                    FAILED ("WRONG EXCEPTION RAISED - P2D1");
          END P2D;

     BEGIN  -- (D2)
          P2D (IDENT_INT(1), IDENT_INT(2));
     EXCEPTION
          WHEN OTHERS =>
               FAILED ("EXCEPTION RAISED IN CALL TO P2D");
     END;   -- (D2)








-------------------------------------------------------------------------------
Edward V. Berard                                | Phone: (301) 353-9652
Berard Software Engineering, Inc.               | FAX:   (301) 353-9272
18620 Mateney Road                              | E-Mail: eberard@bse.com
Germantown, Maryland 20874                      | 
-------------------------------------------------------------------------------