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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-15 22:10:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc03.POSTED!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: <3EE7CC70.E1FD3A67@adaworks.com> <3EECA772.4B662024@adaworks.com> Subject: Re: Ideas for Ada 200X X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: NNTP-Posting-Host: 12.211.13.75 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc03 1055740174 12.211.13.75 (Mon, 16 Jun 2003 05:09:34 GMT) NNTP-Posting-Date: Mon, 16 Jun 2003 05:09:34 GMT Organization: AT&T Broadband Date: Mon, 16 Jun 2003 05:10:15 GMT Xref: archiver1.google.com comp.lang.ada:39215 Date: 2003-06-16T05:10:15+00:00 List-Id: "Richard Riehle" wrote in message news:3EECA772.4B662024@adaworks.com... > Steve wrote: > > > In my opinion the benefit of += has nothing to do with efficiency or ease in > > writing. It's all about readability. > > If we adopt this syntax, in Ada, we will need to include some rules in the > language to enable the compiler to discern a clear difference between > the += and :=. That is, in Ada's current model, we want to compiler to > be able to tell us when a construct is a mistake or warn us when it will > potentially create an incorrect execution. > > What rule can you come up with that will enable the compiler to, at minimum, > warn the programmer that this, > > i := 1; > i += 1; > > poses no hazard. It is bad enough that, in many derivates from C, a legal but > > erroneous code can be created when the programmer confuses the = and the = =. > This cannot currently happen in Ada, ever. > > So, if there is some approach that will ensure that my i += 1 could not be a > mistake > for i := 1, that would go a long way toward making it an acceptable construct. [snip] > So, when you can define, using well-formed semantics, how the compiler will > be improved (not the popularity of the language), how error-checking will be > sustained, and how my own stupidity will be mitigated, by the addition of this > feature, I will gladly admit my error and support your proposal. At this point, > > however, the proposal seems to be based largely on the notion that, "If C and > its derivatives has it, it must be good." That is not good enough for me. I > need > more carefully reasoned exposition. Quite the contrary. For the most part I think that if C and C derivatives have it, it must be carefully scrutinized. BTW: I don't really like the "+=" syntax, I like the functionality. I would prefer something that is easier to distinguish, but has the same function. I don't have anything I think is a good syntax though. For "count := count + 3: I've considered: "+".(count, 3); count'In_Place( "+", 3 ); Integer'In_Place( count, 3, "+" ); With a good syntax, such functionality would I think be a good thing. > > Richard Riehle >