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!news4.google.com!postnews.google.com!8g2000prt.googlegroups.com!not-for-mail From: richard Newsgroups: comp.lang.ada Subject: Re: What's wrong with C++? Date: Fri, 18 Feb 2011 03:34:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <065e06c2-13df-4ef0-8e71-e0f835f7380f@8g2000prt.googlegroups.com> References: <104cfd9f-dbf5-4f05-9c4a-a2319dd371a9@glegroupsg2000goo.googlegroups.com> <4d5d0c16$0$6972$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: 98.234.34.183 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1298028853 32219 127.0.0.1 (18 Feb 2011 11:34:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 18 Feb 2011 11:34:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 8g2000prt.googlegroups.com; posting-host=98.234.34.183; posting-account=6RZ6VgoAAADXiTd8OFh198EMjEniHueR User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17418 Date: 2011-02-18T03:34:13-08:00 List-Id: On Feb 17, 3:52=A0am, Georg Bauhaus wrote: > On2/17/11 12:04 PM, J-P. Rosen wrote: > > > Le 17/02/2011 00:35, Peter C. Chapin a crit : > >> A macro defined in someheader.h might change the meaning of the > >> declarations in someotherheader.h. > > And especially the following one: > > #define private public > > > Great for those who think that information hiding is a nuisance! > > It is good to know that source code transformation > can change the meaning of source text. =A0I don't think > this argument will convince. =A0Is there substantial evidence > of programs that #define private to be public? Might be. > The change is a conventional trick to use with introspective > languages, and useful. > > But anyway, the argument is easily refuted as by > firing this riposte: > > procedure Safe is > > =A0 =A0 =A0function "+" (Left, Right: Integer) return Integer is > =A0 =A0 =A0begin > =A0 =A0 =A0 =A0 =A0return 0; > =A0 =A0 =A0end "+"; > > =A0 =A0 =A0A : array (Integer range 1 .. 2) of Integer; > begin > =A0 =A0 =A0for K in A'Range loop > =A0 =A0 =A0 =A0 =A0A (A'First + K - 1) :=3D 666; > =A0 =A0 =A0end loop; > end Safe; > > Make "+" a little more obscure (if possible) and have > a proponent of Ada look for the error... > > Or talk about the possibility (or not) of changing the > definition of Integer temporarily to a debugging version > of Integer whose operations we can trace. We do not use predefined type integer in production code. If you define your own constrained integer type, this is not likely to be a problem.