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: a07f3367d7,ab1d177a5a26577d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!195.96.0.7.MISMATCH!newsfeed.utanet.at!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: What's wrong with C++? Date: Thu, 17 Feb 2011 15:30:49 +0100 Organization: Adalog Message-ID: References: <104cfd9f-dbf5-4f05-9c4a-a2319dd371a9@glegroupsg2000goo.googlegroups.com> <4d5d0c16$0$6972$9b4e6d93@newsspool4.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 17 Feb 2011 14:30:56 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="vslmL83UgSXHD8TS0/yPxA"; logging-data="17021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Osu8QWO5PH9NeobceuN+Y" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: <4d5d0c16$0$6972$9b4e6d93@newsspool4.arcor-online.net> Cancel-Lock: sha1:SBKeDJlVsnUR0f9X7mnRSSiYK84= Xref: g2news1.google.com comp.lang.ada:17336 Date: 2011-02-17T15:30:49+01:00 List-Id: Le 17/02/2011 12:52, Georg Bauhaus a �crit : > But anyway, the argument is easily refuted as by > firing this riposte: > > procedure Safe is > > function "+" (Left, Right: Integer) return Integer is > begin > return 0; > end "+"; > > A : array (Integer range 1 .. 2) of Integer; > begin > for K in A'Range loop > A (A'First + K - 1) := 666; > end 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. > Of course, any feature can be misused. I once met in a program: Thousand : constant := 10_000; And of course, later there was: for I in 1..Thousand loop... You could argue from this that named numbers should never be used. Back to the point, the big difference is that with macros, you can't assume the meaning of something at a given point of text. While in Ada, you can always point to an entity, then "goto declaration" (assuming a decent environment, like Emacs or GPS), and then you know the truth. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00