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,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-30 21:30:54 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: 30 May 2003 21:30:54 -0700 Organization: http://groups.google.com/ Message-ID: References: <6a90b886.0305262344.1d558079@posting.google.com> <3ED41344.7090105@spam.com> <3ED46D81.FF62C34F@0.0> <3ED46E07.4340CABC@0.0> <3ED4F3FD.A0EF7079@alfred-hilscher.de> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054355454 24103 127.0.0.1 (31 May 2003 04:30:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 31 May 2003 04:30:54 GMT Xref: archiver1.google.com comp.lang.ada:38172 Date: 2003-05-31T04:30:54+00:00 List-Id: Robert A Duff wrote in message news:... > 18k11tm001@sneakemail.com (Russ) writes: > > > And let's not forget that +=, -=, etc. also allow for more efficient > > in-place vector/matrix operations because they avoid the need for a > > temporary. If you don't understand this, that's OK, but please don't > > argue with me because you will be wrong. > > I can't let *that* slip by... ;-) > > Calling the procedure += instead of, say, Add_Matrix will not make it > faster! The += notation is purely syntactic sugar, and has nothing > to do with efficiency. > > - Bob OK, I guess I wasn't clear enough. I meant that A += B is (if properly implemented) much more efficient than A := A + B. For anyone who doesn't understand why, it is because the latter requires the construction of a temporary to hold the sum, then a copy of the sum back over to A. Yes, you can always define Add_Matrix(A,B), or even Add_Matrix(Into=>A,From=>B), but if that appeals to you ... oh, forget about it. Yes, += is syntactic sugar. So is +, for that matter. After all, you can always write a function called Plus(A,B). Do you therefore recommend we dump +? Come to think of it, programming languages in general really boil down to "syntactic sugar," don't they. We could just use machine language.