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.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,THIS_AD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-16 15:07:07 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: += in ada Date: 16 Oct 2003 15:07:07 -0700 Organization: http://groups.google.com Message-ID: References: <3F7316F7.219F@mail.ru> <49cbf610.0310101231.2358762a@posting.google.com> <49cbf610.0310150616.3503a1c4@posting.google.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 1066342027 3666 127.0.0.1 (16 Oct 2003 22:07:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 16 Oct 2003 22:07:07 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:1024 Date: 2003-10-16T15:07:07-07:00 List-Id: Lutz Donnerhacke wrote in message news:... > * Russ wrote: > > Consider the common operation of scaling a vector, for example. I > > could write > > > > vec := vec * factor > > or > > vec :* factor > > > > The first form requires the construction of a temporary, the actual > > scaling operation, then the copying back of the temporary to the > > original vector. The latter, on the other hand, can be written to > > avoid the construction of the temp and the copying back. > > Wrong! In the case of an exception, the original values need to be retained > in order to keep in touch with the current Ada feelings. So any 'idem' > notation or 'augmented assignment' requires a temporary copy as strong than > the original form. We've been over this ad nauseum already. One of the Ada experts clarified it for us, and if I recall correctly, I think you are mistaken. Actually, I think you are "Wrong!". Also, the ":+" form is *not* an assignment statement. It is equivalent to a procedure call. If the procedure call needs a temp, then Ada is inherently less efficient than C++ in that regard.