comp.lang.ada
 help / color / mirror / Atom feed
* semantics of exception when exiting a procedure
@ 1990-08-15  9:29 Daniel Wengelin
  1990-08-15 17:01 ` Brian Hanafee
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Wengelin @ 1990-08-15  9:29 UTC (permalink / 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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1990-08-15 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1990-08-15  9:29 semantics of exception when exiting a procedure Daniel Wengelin
1990-08-15 17:01 ` Brian Hanafee
1990-08-15 17:08 ` Jerry Callen
1990-08-15 17:16 ` Fred Stluka

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