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-16 01:49:13 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 01:49:13 -0700 Organization: http://groups.google.com Message-ID: References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> <3F8BC74F.2CFBFF37@0.0> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1066294153 30253 127.0.0.1 (16 Oct 2003 08:49:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 16 Oct 2003 08:49:13 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:956 Date: 2003-10-16T01:49:13-07:00 List-Id: Stuart Palin wrote in message news:<3F8BC74F.2CFBFF37@0.0>... > Regarding this vociferous debate on the matter of operators > such as ":+=" (or however you choose to denote it). > > May I ask how it might be squared with the ability to > declare and rename other operator functions and using such > operators in a post-fix fashion. > > In the moments of idle curiosity I have given to the matter > the only reasonable interpretation would seem to be to treat > them not as specific operators in their own right, but as a > syntactic equivalent to the use of a more basic operator. > > e.g. a :+= b; is equivalent to a := a + b; > > Then any redefinition of "+" is inherited by ":+=". But Actually, a competent programmer will define the "+" operator in terms of the ":+" operator rather than vice versa, because the ":+" is usually more efficient (since it has no need for temporaries and extra copying). > this does not necessarily help clarify any post-fix form of > the operator. > Treating them as operator functions in their own right seems > to create difficulties in defining a workable specification > for the function or leads to the possibility of > "interesting" expressions such as: > a :+= ":+="(b, c); Actually, the augmented assignment operators are symbolic of procedures rather than functions. They should not return anything. (They can return something in C++, but thats only because C++, like C, does not distinguish between functions and procedures.)