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,91cc2b2a631886b8 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Generic Packages Date: 1998/08/11 Message-ID: #1/1 X-Deja-AN: 380070670 References: <35CF1129.4DCB0B15@lmco.com> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-08-11T00:00:00+00:00 List-Id: In article <35CF1129.4DCB0B15@lmco.com> Tory Patnoe writes: > Does the compiler make TWO separate instantiations of int_io in this > case? It would, therefore, make my code larger and take more > time at elaboration? I suspect this is the case and consequently it > would be better to do something like this. > package int_io is new integer_io; use int_io; Normally the overhead for elaborating a generic instantiation is trivial, on the order of a procedure call and a few assignments. However, it is worth noting that combining instances like this can have semantic effects. Integer_IO has two variables, Default_Base and Default_Width that can be set by user, but hardly ever are. (In fact they probably account for two of those assignments during instantiation.) -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...