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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e0433e9cff080c9c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-19 14:38:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!jfk3-feed1.news.algx.net!dca6-feed2.news.algx.net!allegiance!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!spool0900.news.uu.net!reader0902.news.uu.net!not-for-mail Message-ID: <3D10F9ED.5010801@mail.com> Date: Wed, 19 Jun 2002 17:38:53 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Update-in-place assignment References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1024522683 reader2.ash.ops.us.uu.net 8308 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:26442 Date: 2002-06-19T17:38:53-04:00 List-Id: Bill Findlay wrote: > The trouble with the C* "?=" operators, and the derivative proposals made in > this thread, is that they provide a very restricted subset of a much more > general facility. > > E.g. we might have i := idem -1; or i := 1 - idem; > or even x := 0.5 * (1.0 + a*idem); > > What that does not give the C* people is maximal brevity. > The extra expressiveness should more than compensate. No. What it *also* does not give the C++ people is a place to write the code to handle the operation efficiently! The designer of a class can provide the ?= operators for that class, and write the code to perform the operation. With your suggestion, we have the expressiveness, but we can't do anything with it. If the only goal is to avoid mentioning a long name more than once, C++ has its version of a renaming clause just like Ada does: double &d = myStruct.itsArray[7].itsPoints[15].z; d = (1 + d) / (1 - d);