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-07 04:56:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: += in ada Date: Tue, 7 Oct 2003 11:56:41 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> <49cbf610.0310070205.2937e71a@posting.google.com> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1065527801 13236 217.17.192.37 (7 Oct 2003 11:56:41 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 7 Oct 2003 11:56:41 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:369 Date: 2003-10-07T11:56:41+00:00 List-Id: * Dmytry Lavrov wrote: > begin > declare_new_name a _for_ X(b(i).all+7); > -- for example, "a is X(b(i).all+7)" > a:=a+2/a; > end; declare a : Typ renames X(b(i).all + 7); begin a := a + 2/a; end; is legal Ada and a common idiom. > "+=" is a idea about in-place operations,and @ is about readability. Both ideas fail on considering a consitent semantic for volatile types and exception handling. In both cases it's necessary to require a temporary copy of the LHS. So nothing is gained from this proposal, beside a clear semantic about access frequency for volatile data (one read and one write access). So I have to conlude, that the whole "idem" Idiom is useless at all. In order to generate a more general solution, the S'Type attibute would helpful, because it's possible to write: declare a : a'Type renames X(b(i).all + 7); begin a := a + 2/a; end; > IMO,in place operations should be used as normal procedures like > inc(a,b) or juliafractalstep(z,c); Yep.