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: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Subprogram Renaming Date: 1996/04/11 Message-ID: #1/1 X-Deja-AN: 146941191 references: <316BC3D6.14E7@csehp3.mdc.com> <316D0370.6A3F@ehs.ericsson.se> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-04-11T00:00:00+00:00 List-Id: 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! 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.