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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr19.news.prodigy.net.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <1175215906.645110.217810@e65g2000hsc.googlegroups.com> <1175230700.925143.28490@n59g2000hsh.googlegroups.com> <6XbPh.4025$u03.802@newssvr21.news.prodigy.net> <1175491660.511530.58430@y80g2000hsf.googlegroups.com> <_esTh.11650$eC.2533@trndny03> Subject: Re: why learn C? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: NNTP-Posting-Host: 70.134.100.216 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr19.news.prodigy.net 1177264377 ST000 70.134.100.216 (Sun, 22 Apr 2007 13:52:57 EDT) NNTP-Posting-Date: Sun, 22 Apr 2007 13:52:57 EDT Organization: AT&T http://yahoo.sbc.com X-UserInfo1: TSUGW^WETZSMB_DX]BCBNWX@RJ_XPDLMN@GZ_GYO^JWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Date: Sun, 22 Apr 2007 10:53:04 -0800 Xref: g2news1.google.com comp.lang.ada:15221 Date: 2007-04-22T10:53:04-08:00 List-Id: "Hyman Rosen" wrote in message news:_esTh.11650$eC.2533@trndny03... > adaworks@sbcglobal.net wrote: >> This tends to increase, not decrease, the dependability since each > > instantiation is checked at compile-time. > > Every C++ template instantiation is done, and therefore checked, > at compile-time. It's Ada that has run-time instantiation (with > compile-time checking). > As you note, the checking is done at compile-time in Ada. generic type Num is range <>; package ... When I instantiate Num with some actual type, the unit containing that type has already been checked at compile time of the instantiation will not compile. The package being instantiated is using that type instead of some phantom type. I have looked at the C++ instantiation model and I find it confusing and error-prone -- especially at the human level. Several months ago I had to go over it with a colleague who was trying to unravel its complexity in a piece of code he inherited. He finally got it, but not without a lot of head-scratching. To suggest that C++ is more dependable in its template model, or in any other way, than Ada, is simply wrong -- or a strained interpretation of the relative language designs. Richard Riehle