From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 29 Jun 93 23:20:41 GMT From: mcsun!fuug!prime!mits!rkaivola@uunet.uu.net (Risto Kaivola) Subject: Re: Elaboration and parameters Message-ID: List-Id: Several people have pointed out that the original program is no good for illuminating the issue because it won't be capable of being bound. The reason that the example turned out incorrect is that I had actually a longish, working sample program, and decided to strip it down a bit, and didn't bother to check the new version even by compiling it. Yes, I should have known better, but I though it obvious it would work :-). Nevertheless, you all understood my intent correctly. In case someone is interested, here is the original example program, which should be correct apart from possible types made in keying it in for this post. -------------------- [sample program] -------------------- --- Compilation unit 1 --- package P1 is MY_EXCEPTION : exception; subtype S is INTEGER range 0 .. 1; function EXCEPT(ARG : S) return S; end P1; --- Compilation unit 2 --- package body P1 is function EXCEPT(ARG : S) return S is begin raise MY_EXCEPTION; return S(0); end EXCEPT; end P1; --- Compilation unit 3 --- with P1; package P2 is procedure PROC(ARG : P1.S); end P2; --- Compilation unit 4 --- package body P2 is procedure PROC(ARG : P1.S) is begin null; end PROC; end P2; --- Compilation unit 5 --- with TEXT_IO; use TEXT_IO; with P1, P2; pragma ELABORATE(P1); -- Note: no ELABORATE pragma for P2. procedure MY_MAIN is OBJ : P1.S := 0; begin P2.PROC(P1.EXCEPT(OBJ)); -- What happens here if the body of P2 has not yet been elaborated? exception when PROGRAM_ERROR => PUT("NE"); when P1.MY_EXCEPTION => PUT("E"); end MY_MAIN; ----------------- [end of program] ----------------- But anyway, if one of the exception handlers of the procedure MY_MAIN is executed, the consensus seems to be that it is implementation dependent whether NE or E is put, or are you of a different opinion? -- Risto Kaivola (Internet address: rkaivola@mits.mdata.fi)