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!news4.google.com!out01a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!news.mailgate.org!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: why learn C? From: Georg Bauhaus In-Reply-To: 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> <1175230352.808212.15550@e65g2000hsc.googlegroups.com> <1175236212.771445.135460@y66g2000hsf.googlegroups.com> <1175308871.266257.77460@e65g2000hsc.googlegroups.com> <1175499821.557815.303270@y80g2000hsf.googlegroups.com> <1175511246.9702.24.camel@localhost> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1176412291.5632.50.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Date: Thu, 12 Apr 2007 23:11:32 +0200 NNTP-Posting-Date: 12 Apr 2007 22:10:01 CEST NNTP-Posting-Host: 48bae3cf.newsspool1.arcor-online.net X-Trace: DXC=gS63EA=Y^HD0YVY]kmLTlDic==]BZ:afN4Fo<]lROoRAFl8W>\BH3YBbUAlUhAg9VCA:ho7QcPOVCX:ST36WRk]M97SUY3ThR0D X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14962 Date: 2007-04-12T22:10:01+02:00 List-Id: On Thu, 2007-04-12 at 16:05 +0000, Hyman Rosen wrote: > Georg Bauhaus wrote: > > And then, unfortunately, C++ doesn't have dynamic types > > (unless I'm missing something): > > > > template > > int foo(int n) > > { > > typedef class RangedInt Int; > > You are correct that C++ does not support this, but > incorrect that it is unfortunate. I beg to differ. When there are reasons not to support this kind of nesting in C++, I still see nesting of things including types as a feature of Ada that is valuable. Much like local subprograms can act as a locally needed singleton with suitably restricted visibility of its surroundings: there is no need for a singleton at the service of a single subprogram, say. But there are local packages, local types, ..., and now inward closures. Is a std::unary_function so much more attractive for the cases it can handle?