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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-18 15:37:11 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? Date: 18 Sep 2003 15:37:09 -0700 Organization: http://groups.google.com/ Message-ID: References: <3F650BBE.4080107@attbi.com> <3F67AAC6.2000906@attbi.com> NNTP-Posting-Host: 128.102.146.44 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1063924630 3520 127.0.0.1 (18 Sep 2003 22:37:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 18 Sep 2003 22:37:10 GMT Xref: archiver1.google.com comp.lang.ada:42671 Date: 2003-09-18T22:37:10+00:00 List-Id: "Mark A. Biggar" wrote in message news:... > Martin Dowie wrote: > > "Russ" <18k11tm001@sneakemail.com> wrote in message > > news:bebbba07.0309171110.192b565c@posting.google.com... > > > >>In the previous thread, someone claimed that "+=" needs a temporary > >>too for some sort of overflow checking (I don't recall the exact > >>reason given). If that is true, then it is an example of an inherent > >>inefficiency built in to Ada. For better or worse, C++ has no such > >>inefficiency. (I'm just stating a fact, I am *not* claiming that C++ > >>did it right.) > > > > > > And Ada will not have this "inefficiency" if _you_ select to remove the > > checks. The difference is that you do it _explicitly_ in Ada. > > > > To have equivilent code in C++ if would have to hand-write the > > check and then throw the exception. > > > > You may or may not be able to turn this off. The problem is that the > Ada LRM says that on any assignment if an exception is raised when > evaluating the RHS then the LHS shall be left unchanged. So unless the > compiler can determine that no such exception is possible it has to use > a temporary. This of course is yet another instance of solving the > halting problem in the general case. I have been told by a prominent Ada expert on this forum that "+=" is just "semantic sugar" for a procedure call, and I have no reason to doubt it. My understanding is that a procedure in Ada involves no LHS. If that is the case, then I conclude that "+=" involves no LHS either. Why, then, would this even be an issue? > Now. as Ada doesn't currently have ops like += they could be add to the > language in such a way to not abide by the above rule. But, that would > break the semantic equavalence between "A := A + B;" and "A += B;". > It also gets all messed up with issues involving user defined ops and > controlled types. As I wrote above, I don't think the "above rule" even applies. I think this is just another excuse to keep augmented assignment operators out of Ada. Unfortunately, I think that will also help keep Ada out of use.