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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Generics vs. O-O? Date: Fri, 02 Aug 2013 01:38:06 +0200 Organization: Ada @ Home Message-ID: References: <6238c325-79c5-4537-ba55-2800110dc6df@googlegroups.com> <1wugpqyea6s39$.e2e8eshup5wn$.dlg@40tude.net> NNTP-Posting-Host: hWReKAHBL3fTiVJcngrJiA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:16651 Date: 2013-08-02T01:38:06+02:00 List-Id: Le Thu, 01 Aug 2013 22:10:39 +0200, a =C3=A9crit: > On Thursday, August 1, 2013 2:24:57 PM UTC-5, Dmitry A. Kazakov wrote:= >> [... snip ...] >> 5. Considering run-time effects generics obviously have none because = it = >> is >> static polymorphism. >> [... snip ...] > > Not so fast. Your statement on your #5 is true for C++ templates, but= = > not true for Ada generics. The difference is that instantiations by = > different combinations of template-parameters of a C++ template result= = > in a combinatorial explosion of the quantity of instances of that = > template's machine code & static data. > > Conversely, Ada utilizes a single instance of machine code & static da= ta = > for an Ada generic, regardless of the type parameters passed at = > compile-time. [=E2=80=A6] Not sure =E2=80=9CAda utilizes=E2=80=9D is correct, and rather =E2=80=9C= This/that compiler = utilizes=E2=80=9D is. What compiler do you use? -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity