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 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-21 05:45:51 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stueberl.de!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: += in ada Date: Tue, 21 Oct 2003 12:45:51 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <1066231159.711433@master.nyc.kbcfp.com> <1066311805.222491@master.nyc.kbcfp.com> <3F8F3077.60402@comcast.net> <3F900F35.50203@comcast.net> <3F92B607.809@comcast.net> <3F937806.9080205@comcast.net> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1066740351 28784 217.17.192.37 (21 Oct 2003 12:45:51 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 21 Oct 2003 12:45:51 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:1280 Date: 2003-10-21T12:45:51+00:00 List-Id: * Russ wrote: > "Robert I. Eachus" wrote in message news:<3F937806.9080205@comcast.net>... >> in a nutshell. Chad even gave a perfect riposte, to the question of >> side effects. The statement x += y += 1; is perfectly legal C, and I'll >> let Russ choose what is the effect, and what is the side effect. > > I'll tell you exactly what the effect is: a compile error. You should learn even C before ranting any further. $ cat >t.c #include #include int main(void) { int a = 1, b = 2; printf("a = %d\nb = %d\n", a, b); printf("Result: %d\n", a += b += 1); printf("a = %d\nb = %d\n", a, b); return EXIT_SUCCESS; } $ make t cc t.c -o t $ ./t a = 1 b = 2 Result: 4 a = 4 b = 3 $ _ > And I must say that I am a bit surprised that this is not obvious to you. Your attitude does not match you knowledge. That's not funny. > "+=" would be a procedure, and my understanding of procedures in Ada is > that they do *not* return a value. Yep. But we talked about C in this paragraph. > Am I missing something here? Yes: The language context.