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-22 00:24:51 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: 22 Oct 2003 00:24:51 -0700 Organization: http://groups.google.com Message-ID: References: <1066311805.222491@master.nyc.kbcfp.com> <3F8F3077.60402@comcast.net> <3F900F35.50203@comcast.net> <3F92B607.809@comcast.net> <3F937806.9080205@comcast.net> <3F953687.9070406@comcast.net> NNTP-Posting-Host: 63.194.87.148 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1066807491 23085 127.0.0.1 (22 Oct 2003 07:24:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 22 Oct 2003 07:24:51 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:1374 Date: 2003-10-22T00:24:51-07:00 List-Id: "Robert I. Eachus" wrote in message news:<3F953687.9070406@comcast.net>... > Russ wrote: > > > I'll tell you exactly what the effect is: a compile error. And I must > > say that I am a bit surprised that this is not obvious to you. "+=" > > would be a procedure, and my understanding of procedures in Ada is > > that they do *not* return a value. > > Correct, IN ADA procedures do not return a value. > > > Let's consider either possibility for operator precedence: > > > > x += ( y += 1 ); > > or > > ( x += y ) += 1; > > > > The first grouping will not compile because the expression in parens > > returns no value. The second grouping will not compile because, as far > > as I know, a procedure cannot be an lhs (because it cannot return a > > reference, as in C++). Am I missing something here? > > Yes. I understand the C (or C++) meaning perfectly. But when you > blithely talk about how Ada does not have augmented assignment and > should, you may know perfectly well what you have in mind, but the ARG > has got to understand things in gory detail to change the language. I think "+=" or ":+" should be exactly equivalent to a procedure call. Nothing more. Nothing less. A procedure does not return anything, and neither should "+=". Sorry if that was not clear, but I really don't understand why it wasn't. Did I ever suggest that "+=" should be like a C function, with side effects *and* returning a value? I certainly don't recall suggesting anything like that. If I had, then your objections would have had some merit, but I did not.