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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ab1d177a5a26577d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!o39g2000prb.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: What's wrong with C++? Date: Wed, 16 Feb 2011 19:35:46 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <104cfd9f-dbf5-4f05-9c4a-a2319dd371a9@glegroupsg2000goo.googlegroups.com> NNTP-Posting-Host: 174.28.187.177 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1297913746 20100 127.0.0.1 (17 Feb 2011 03:35:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 Feb 2011 03:35:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o39g2000prb.googlegroups.com; posting-host=174.28.187.177; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17323 Date: 2011-02-16T19:35:46-08:00 List-Id: On Feb 16, 3:35=A0pm, "Peter C. Chapin" wrote: > On Wed, 16 Feb 2011, Hyman Rosen wrote: > > It sounds like a complaint that C++ requires source inclusion (directly= or > > via preprocessor #include directives) of type and object declarations i= nto > > a compilation unit, while other languages have syntax for requesting a > > type set (class, package, etc.) whose definition is then sought out by = the > > compiler in an implementation-dependent way. Personally, I don't find t= he > > long strings of 'import ...;' or 'with ...; use ...;' statements any mo= re > > appealing than '#include "header.h"', but I suppose it's "purer". > > C++'s model of #include is a major project because the compiler does not > really know what is going on and the preprocessor can do arbitrary editin= g > of source code. For example > > #include > #include > > A macro defined in someheader.h might change the meaning of the declarati= ons > in someotherheader.h. I've had this happen to me many times... in headers > that I did not write and over which I have no control. Often the problem = can > be fixed by rearranging the order of #includes or by selectively #undef > certain macros. However, it's a problem that just shouldn't exist. > > Peter Also, one can use precisely that behavior to crash the pre-processor: //Test.h #include