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,1d321b3a6b8bcab2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-25 00:50:22 PST Path: nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!epflnews!dinews.epfl.ch!lglsun!nebbe From: nebbe@lglsun.epfl.ch (Robb Nebbe) Newsgroups: comp.lang.ada Subject: Re: "Subtract C, add Ada" Date: 25 Jan 1995 08:50:22 GMT Organization: Ecole Polytechnique Federale de Lausanne Sender: nebbe@lglsun3.epfl.ch (Robb Nebbe) Distribution: world Message-ID: <1995Jan25.093721@lglsun.epfl.ch> References: <3fo2ot$su2@miranda.gmrc.gecm.com> NNTP-Posting-Host: lglsun3.epfl.ch Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: 1995-01-25T08:50:22+00:00 List-Id: In article , lawnm@leeds.ac.uk (N. Mellor) writes: |> |> This seems a valid point to me, particularly because += |> simplifies and clarifies expressions, particularly complex ones. I |> don't think there'd be much disagreement over this one, for example: |> |> foo( bar( zot( element + 1))) = foo( bar(zot( element + 1))) + 1; |> |> foo( bar( zot(element + 1))) += 1; |> |> The second clearly saves on mistakes and makes the whole line more readable. |> To check the first, you need to do a mechanical, lexeme by lexeme comparison |> of the two array references to check that they're the same-- not a great score |> in the readability stakes. This is a clear example of C shorthand being |> superior, in some situations, in some respects, to Ada's straightforwardness. |> It isn't the whole story, of course. For problems like this I would rename the foo term: declare Following_Element : Integer renames foo( bar( zot( element + 1 ))); begin if Following_Element < Limit then Following_Element := Following_Element + 1; else Following_Element := Following_Element + 10; end if; end; I don't really see the benefit of operators like += in a language. As an aside to no one in particular if you find you have lots of complicated terms like this in your code you should take it as a hint that there might be a problem with the design. Robb Nebbe