comp.lang.ada
 help / color / mirror / Atom feed
* Is There Anything "Wrong" With This Code?
@ 1990-08-07 16:46 Edward V. Berard
  0 siblings, 0 replies; only message in thread
From: Edward V. Berard @ 1990-08-07 16:46 UTC (permalink / raw)


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                      | 
-------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1990-08-07 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1990-08-07 16:46 Is There Anything "Wrong" With This Code? Edward V. Berard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox