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: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: OO, C++, and something much better! Date: 1997/01/06 Message-ID: <5arhb0$d4e@top.mitre.org>#1/1 X-Deja-AN: 208111063 references: <32ce7009.280817694@news.zip.com.au> <32D0CA27.44C2@ghgcorp.com> organization: The MITRE Corporation, Bedford Mass. newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-06T00:00:00+00:00 List-Id: Yes, there is some added flexibility in C++ templates over Ada generics, and vice versa too. The added flexibility in C++ templates comes from the ability to expand them at compile time without losing optimizations, unlike Ada generics whose paradigm is to expand at run-time and remove staticness from expressions. The added flexibility in Ada templates comes from the added flexibility in Ada packages, which can have BOTH types and functions. An ideal generic would have all of the Ada features plus the following: (a) anything that was static in the package while you were testing it, that is, before you made it generic, remains static after you genericized the package; (b) there is a standard pragma that tells the compiler to expand the generic at compile time, (c) there is a formal generic parameter type that works on EITHER modular or twos complement types, and (d) generates the kind of code for each instantiation that keeps track of the line numbers in generic source code, so unhandled exceptions would generate a useful traceback of source code lines through generic packages.