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,ac5c3bc59168d76 X-Google-Attributes: gid103376,public From: Jonas Nygren Subject: Re: Subprogram Renaming Date: 1996/04/12 Message-ID: <316E1AFC.596D@ehs.ericsson.se>#1/1 X-Deja-AN: 147078026 references: <316BC3D6.14E7@csehp3.mdc.com> <316D0370.6A3F@ehs.ericsson.se> content-type: text/plain; charset=us-ascii organization: Ericsson Hewlett-Packard Telecommunications AB mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0GoldB1 (WinNT; I) Date: 1996-04-12T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Jonas asked: > > "But it could be put in the private part, without 'exposing the renaming'. > Robert mentioned before that this had a performance drawback but I can't see > that this would be the case if you have a generic package." > > No, the performance penalty of creating a body occurs only if the renaming > is in the body. Actually, as Bob Duff pointed out, not all compilers > will take advantage of the possible performance gain (equiavlent to > automatic inlining) that completion-with-renaming can provide (GNAT does > not, since it requires renaming capability at the linker level, a feature > that not all linkers provide). However, this performance penalty can in > any case be completely eliminated by use of pragma Inline so in the case > where the renaming-as-body appears in the body it is a shorthand and > nothing more. > > In the private part it is a different feature, but I don't understand > Jonas' comment above. Sure in Ada 83 you could put a renaming in the > private part, and it wouldn't expose the renaming -- it also would not > expose ANYTHING and could not be used by a client of the package and > therefore would be completely useless! Well, I don't know anything about Ada 83 and just a little bit more about Ada 95 :-) > > The ability to use renaming-as-body in the private part is a new Ada 95 > feature which is quite useful, sometimes it can completely eliminate a > package body that would otherwise be required in Ada 83. Sorry, I perhaps misunderstood youre earlier posting. I read this as you were advocating that all renaming should be in the body and then I tried to point out that there could be reasons for doing the renaming in the private part of the spec. My motivation for this was perhaps not the best. ------------------------------------------------------- -- Jonas Nygren -- ehsjony@ehs.ericsson.se -------------------------------------------------------