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=0.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!zaphod.mps.ohio-state.edu!mips!apple!agate!ucbvax!amstel.llnl.gov!KETTERING From: KETTERING@amstel.llnl.gov (Brett 'Bunny Killer' Kettering) Newsgroups: comp.lang.ada Subject: Instantiation of a generic with a procedure's scope Message-ID: <8912221629.AA15395@ajpo.sei.cmu.edu> Date: 22 Dec 89 16:19:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: My question has to do with any run-time cost involved in instantiating a procedure within the scope of a procedure exported by a package. As an example consider solving the problem in two different manners. A procedure AAA is exported by a package (that is that the procedure is one of those specified in the package specification. --------- METHOD A: --------- X : INTERNAL_X_TYPE; procedure AAA ( P1 : in P1_TYPE; P2 : out P2_TYPE; P3 : out P3_TYPE ) is procedure USED_BY_BBB( ELEMENT : in ELEMENT_TYPE ) is begin P2 := ELEMENT.P2; P3 := ELEMENT.P3; end USED_BY_BBB; procedure MY_BBB is new XXX.BBB( USED_BY_BBB ); begin MY_BBB( X, P1 ); end AAA; --------- METHOD B: --------- X : INTERNAL_X_TYPE; GLOBAL_P2 : P2_TYPE; GLOBAL_P3 : P3_TYPE; procedure USED_BY_BBB( ELEMENT : in ELEMENT_TYPE ) is begin GLOBAL_P2 := ELEMENT.P2; GLOBAL_P3 := ELEMENT.P3; end USED_BY_BBB; procedure MY_BBB is new XXX.BBB( USED_BY_BBB ); procedure AAA ( P1 : in P1_TYPE; P2 : out P2_TYPE; P3 : out P3_TYPE ) is begin MY_BBB( X, P1 ); P2 := GLOBAL_P2; P3 := GLOBAL_P3; end AAA; I cannot find any mention in the LRM or any other reference that I have about the run-time costs involved in solving the problem by either of these manners. Does anyone have any words of wisdom? I would prefer the solution by method A, but I need to limit the run-time cost as my procedure AAA will be called often. Brett Kettering KETTERING%AMSTEL@ICDC.llnl.gov