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,start X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: C like op= proposal Date: 1999/08/15 Message-ID: #1/1 X-Deja-AN: 513078459 X-Trace: nntp1.ba.best.com 934738668 13652 bpr@206.184.139.136 Content-Type: TEXT/PLAIN; charset=US-ASCII MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-15T00:00:00+00:00 List-Id: A few weeks ago the topic of the readability of C's op= construct vis-a-vis the Ada "lhs := lhs op operand;" statements, with the general tenor being that the C syntax is more readable, at least in cases where "lhs" is some fairly long identifier, perhaps an array embedded in a record being incremented or otherwise operated upon. I remembered reading about a language which had a more general approach to this, allowing a pseudo-variable, say "@" to represent the old value of the left hand side of an assignment in the right hand side, thus allowing things like lhs := @ + 1; -- C: lhs++; lhs := @ * 5; -- C: lhs *= 5; lhs := 1/@ + 5*(@/2 + @ ** 2); -- C doesn't do so good here either! Was anything like this ever discussed for Ada? Assuming some acceptable notation was chosen for the pseudo-variable ("_" works, but stands out less to my eye than "@"), would people find this more or less readable than the current verbose approach? -- Brian