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,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-17 17:08:41 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: 17 Oct 2003 17:08:41 -0700 Organization: http://groups.google.com Message-ID: References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> <3F8BC74F.2CFBFF37@0.0> <1066312000.671303@master.nyc.kbcfp.com> <1066322883.139702@master.nyc.kbcfp.com> <3F8F372D.9040801@comcast.net> <1066400123.238640@master.nyc.kbcfp.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 1066435721 10248 127.0.0.1 (18 Oct 2003 00:08:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 18 Oct 2003 00:08:41 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:1111 Date: 2003-10-17T17:08:41-07:00 List-Id: Hyman Rosen wrote in message news:<1066400123.238640@master.nyc.kbcfp.com>... > Robert I. Eachus wrote: > > Which makes Ada better for most common CPUs today, right? > > No, you are forgetting that these operators are intended to > be defined for all sorts of types, where the temporaries may > be very large data structures, such as matrices. > > Anyway, I'm not an Ada programmer, so I don't really care if > Ada has these operators or not. If I had to do stuff like this > in Ada, I would just write the appropriate procedures and be > done with it. In C++, I use these operators all the time. I > just did a quick search through the source code we've added to > out trading system and counted around 500 uses of augmented > assignment operators (+=, -=, *=, /=), and yes, we actually do > have a few cases of /=. We also have a few of those complicated > left-hand sides that people talk about; here's one: > > (*fxMap)[exposure.secCurr.id().get_key()] += exposure.secExp; Thanks for that little dose of reality. I hope it wakes up a few people around here (but I doubt it will). I am curious about one thing. In your count of augmented assignment operators, did you count loop incrementors? I would imagine most of those are "++" rather than the basic four you listed, so I will assume (unless you tell me otherwise) that you did not count them. Also, approximately how many lines of code did you look in to find the 500 occurrences? By the way, I have always considered the standard C/C++ "for" construct to be awkward, and I think the Ada looping style is preferable. Then again, many C++ programmers are probablly now using STL iterators in lieu of the old-style "++" idioms.