comp.lang.ada
 help / color / mirror / Atom feed
From: daniel@mizar.docs.uu.se (Daniel Wengelin)
Subject: semantics of exception when exiting a procedure
Date: 15 Aug 90 09:29:50 GMT	[thread overview]
Message-ID: <1616@kuling.UUCP> (raw)

Question:
What are the semantics when a procedure with out parameters is
exited by an exception. Can the out parameters be used, if they
have been assigned prior to the exception ?

Example>
procedure X(P1,P2,P3:out...)is
..
   P1:=....
   if ... raise E1;....
   P2:=....
   if .... raise E2;....
    P3:=...
end X;
.....
X(P1,P2,P3);
Do_Something_With(P1,P2,P3);
exception
   when E1=>Do_Something_With(P1);
    when E2 => Do_Something_With(P1,P2);
..

It would appear that the above code should work, but it does seem
a bit risky.

I would very much appreciate a LRM ref on this one !

/dw/

             reply	other threads:[~1990-08-15  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-08-15  9:29 Daniel Wengelin [this message]
1990-08-15 17:01 ` semantics of exception when exiting a procedure Brian Hanafee
1990-08-15 17:08 ` Jerry Callen
1990-08-15 17:16 ` Fred Stluka
replies disabled

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