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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,198c6302c4a0b0d7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-21 09:39:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.mindspring.com!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: was Re: Ada / C++ comparison paper anymore Date: Fri, 21 Dec 2001 09:44:15 -0800 Organization: AdaWorks Software Engineering Message-ID: <3C2374EE.956EF43B@adaworks.com> References: <3c1dc786@pull.gecm.com> <1008601517.470745@edh3> <1008626816.690418@master.nyc.kbcfp.com> <1008690461.380980@master.nyc.kbcfp.com> <_xRT7.4398$xl6.682759@rwcrnsc54> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cd.3b Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 21 Dec 2001 17:38:51 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:18216 Date: 2001-12-21T17:38:51+00:00 List-Id: > In article <_xRT7.4398$xl6.682759@rwcrnsc54>, Mark Lundquist says... > >"Brian Rogoff" wrote in message > >news:Pine.BSF.4.40.0112181924260.32168-100000@bpr.best.vwh.net... > > > >> happy with a bit more shorthand, like +:= > > > >As long as it doesn't return a value :-) > > > >I might prefer a more longhand shorthand :-), e.g. > > > > X'Increment; -- (X names object of integer type) > > X'Increase (By => 1.23); -- (X names object of any numeric type, > >here a FP type) > > etc... I recall seeing something like this in a program written at one of our client sites. package Counter is type Count is private; function Inc (Data : Count) return Count; function Dec (Data : Count) return Count; procedure Set_Increment (Data : in out Integer); Overflow, Underflow : exception; private type Count is ... end Counter; One could easily envision the functions as: function Inc (Data : Count; By : Integer) return Count; function Dec (Data : Count; By : Integer) return Count; It may seem like a little bit of overkill, but worked out quite well for the problem at hand. It was useful all through the project when some kind of counter was needed. It was easy to abuse its behavior. This is not the kind of shorthand that a += might provide, but it was no hardship for those using it. Of course, there is no possible Beaujolais effect either. :-) Richard Riehle