From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,16e3a8dd4f3ab3f3 X-Google-Attributes: gid103376,public From: stt@henning.camb.inmet.com (Tucker Taft) Subject: Re: Elaboration order Date: 1996/03/15 Message-ID: #1/1 X-Deja-AN: 142842824 sender: news@inmet.camb.inmet.com (USENET news) x-nntp-posting-host: henning.camb.inmet.com references: <314829CD.4FA9@lfwc.lockheed.com> organization: Intermetrics, Inc. newsgroups: comp.lang.ada Date: 1996-03-15T00:00:00+00:00 List-Id: Ken Garlington (GarlingtonKE@lfwc.lockheed.com) wrote: : Chris McKnight wrote: : > : > LRM References? Hmm.. how about (taken from ANSI/MIL-STD-1815A-1983): : > : > 7.3 paragraph 4 : : > "The elaboration of the body of a subprogram declared in the visible : > part of a package is caused by the elaboration of the body of the : > package. Hence a call of such a subprogram by an outside program : > unit raises the exception PROGRAM_ERROR if the call takes place : > before the elaboration of the package body" : So what does this mean in the following case: : package Another_Example is : function Initial_Value return Integer; : end; : package body Another_Example is : function Initial_Value return Integer is begin return 0; end; : end; : with Another_Example; : package Use_Example is : X : Integer := Another_Example.Initial_Value; : end; : Can I get a Program_Error on the initialization of X? If so, : it would seem like there would need to be a pragma : Elaborate for nearly every reference to every package : exporting a subprogram! You only need a pragma Elaborate[_All](pkg) if you call a subprogram from "pkg" as part of the *elaboration* of some other package. If the calls only appear in subprogram bodies, rather than at the package level, you shouldn't have any problem. -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Cambridge, MA USA