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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,10444cff97404845 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: C like op= proposal Date: 1999/08/15 Message-ID: #1/1 X-Deja-AN: 513241522 References: Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 934778247 202 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-15T00:00:00+00:00 List-Id: On 15 Aug 1999, Ray Blaak wrote: > Brian Rogoff writes: > > lhs := @ + 1; -- C: lhs++; > > lhs := @ * 5; -- C: lhs *= 5; > > lhs := 1/@ + 5*(@/2 + @ ** 2); -- C doesn't do so good here either! > > This is not worth the trouble of changing the language, especially considering > that one can already do this: > > declare > lhs : Some_Type renames Long_And_Complicated_Lvalue; > begin > lhs := lhs + 1; -- C: lhs++; > lhs := lhs * 5; -- C: lhs *= 5; > lhs := 1/lhs + 5*(lhs/2 + lhs ** 2); -- C doesn't do so good here either! > end; Well, that won't work for the case I described, in which lhs is or contains an array being indexed, unless you rename each occurrence every time through the loop. But I guess that would be the correct Ada approach. Seems awfully heavyweight compared to the C approach and what I sketched. It's certainly not any more than syntactic sugar, but if I were designing my own Ada like language from scratch, would it be worth including such a facility? -- Brian