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.9 required=5.0 tests=BAYES_00,FROM_NUMERIC_TLD 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-15 19:40:09 PST Message-ID: <3F8BC74F.2CFBFF37@0.0> Date: Tue, 14 Oct 2003 10:52:15 +0100 From: Stuart Palin X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: += in ada References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: rc2966.rochstr.gmav.gecm.com X-Trace: baen1673807.greenlnk.net!baen1673807 1066124932 rc2966.rochstr.gmav.gecm.com (14 Oct 2003 10:48:52 +0100) Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.cwix.com!nntp.abs.net!lore.csc.com!baen1673807.greenlnk.net!baen1673807!not-for-mail Xref: archiver1.google.com comp.lang.ada:940 Date: 2003-10-14T10:52:15+01:00 List-Id: 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 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); I presume that it might be treated like any other function (where an exception may be raised during execution) - but that seems to lead us into one of the other arguments debated elsewhere (should LHS be updated/unaffected if there is an exception). If the post-fix form (or multiple infixed operators) were allowed, would any special precautions be needed for "pathological" cases. (I'm thinking of code like: a :+= ":+="(a, a); ) I suppose the other option would be to treat them not as operators but as "assignments" (and so not support renaming on post-fix notation) - but there seems to be a tendency in these threads to refer to them as "operators". -- Stuart Palin