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,b375f07e05d12c7a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-13 21:56:06 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: 18k11tm001@sneakemail.com (Russ) Newsgroups: comp.lang.ada Subject: Re: efficient vector/matrix operations in Ada Date: 13 Aug 2001 21:56:06 -0700 Organization: http://groups.google.com/ Message-ID: References: <3B6F40C1.FD215D1D@sneakemail.com> <3B6F5ABC.3C40E189@sneakemail.com> <9f6e2b77.0108100854.66b084b4@posting.google.com> NNTP-Posting-Host: 24.178.46.154 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 997764966 26720 127.0.0.1 (14 Aug 2001 04:56:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 14 Aug 2001 04:56:06 GMT Xref: archiver1.google.com comp.lang.ada:11888 Date: 2001-08-14T04:56:06+00:00 List-Id: Ted Dennison wrote in message news:... > In article , Russ says... > (talking about matrices with redefined math ops) > >Here's how you write "A = B + C + D;" efficiently: > > > > A = B; > > A += C; > > A += D; > > > >really needs arithmetic assignment operators. Sure, you can use > >procedures, but they're intent and effect is not as obvious to the > >reader. > > Perhaps to a reader who is *already* familiar with the idiom above that is true. > I'm not, and it took me a couple of takes to see what you were doing here (and a > bit of thought to figure out why). For someone starting from ground zero, I > think the point is quite arguable. If you know even a tiny bit of C++, the "+=" notation is very obvious. And it's use here in my example of matrix addition is perfectly consistent with its use for normal scalar addition. No, you don't absolutely need those operators, but neither do you need to be able define your own "+", "-", etc. in Ada either. So why does Ada have some nice-looking operators but not have the operators one really needs for efficient code? I guess the goofy syntax isn't the only problem with Ada, eh? Russ