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,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-03 07:38:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!c03.atl99!rip!news.webusenet.com!peer01.cox.net!cox.net!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-binary.blueyonder.co.uk.POSTED!53ab2750!not-for-mail User-Agent: Microsoft-Entourage/10.1.1.2418 Subject: Re: Ideas for Ada 200X From: Bill Findlay Newsgroups: comp.lang.ada Message-ID: References: <6a90b886.0305262344.1d558079@posting.google.com> <6vWcnTWjF83bD0qjXTWcpA@gbronline.com> <3EDC8AA9.7000405@noplace.com> Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Date: Tue, 03 Jun 2003 15:37:11 +0100 NNTP-Posting-Host: 80.195.75.181 X-Complaints-To: abuse@blueyonder.co.uk X-Trace: news-binary.blueyonder.co.uk 1054651095 80.195.75.181 (Tue, 03 Jun 2003 14:38:15 GMT) NNTP-Posting-Date: Tue, 03 Jun 2003 14:38:15 GMT Organization: blueyonder (post doesn't reflect views of blueyonder) Xref: archiver1.google.com comp.lang.ada:38486 Date: 2003-06-03T15:37:11+01:00 List-Id: On 3/6/03 15:22, in article bbiav9$4np$1@a1-hrz.uni-duisburg.de, "Georg Bauhaus" wrote: > Lutz Donnerhacke wrote: > > : The common > : idiom X := X + Y; is error prone, because X might be evaluated twice without > : notice. > > Still, in > X +:= Y; > X might be evaluated during evaluation of Y, without notice. > Same in Add(Using => X, Adding => Y). > > What about X +:= g(X) + f(X); The 'idem' proposal allows the programmer to state precisely how these issues are to be resolved in any particular case. E.g. If Y above if a a function f(X), I can write: X := idem + f(idem); or: X := idem + f(X); or: X := X + f(idem); or: X := X + f(X); depending on what I want. The C-style ?= operators couple evaluation and assignment. As we all know, unnecessary coupling is a Bad Thing. 8-) -- Bill-Findlay chez blue-yonder.co.uk ("-" => "")