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,a4d2751f9487bd38 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-07 14:31:42 PST Message-ID: <3F09E6B8.FB19B956@somewhere.nil> Date: Mon, 07 Jul 2003 23:31:36 +0200 From: Gautier Write-only X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Inc (was: Real data for a change in the assignment operators and Bounded_String discussions. ) References: <3F04F778.5090305@attbi.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.218.95.203 X-Trace: news.swissonline.ch 1057613502 80.218.95.203 (7 Jul 2003 23:31:42 +0200) X-Complaints-To: abuse@swissonline.ch 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!proxad.net!newsfeed.stueberl.de!newsfeed.vmunix.org!news.imp.ch!news.imp.ch!news-zh.switch.ch!switch.ch!news.swissonline.ch!not-for-mail Xref: archiver1.google.com comp.lang.ada:40116 Date: 2003-07-07T23:31:36+02:00 List-Id: > >I don't expect this to end the discussion on these two issues, but I > >hope it helps. The three calls in a row to Inc are much clearer than: > > > > Total := Total + 1; > > Single(Data(I)) := Single(Data(I)) + 1; > > Digraphs(Previous,Data(I))) := Digraphs(Previous,Data(I)) + 1; Alexander Kopilovitch: > I think Pascal language was aware of that even before Ada emerged. You certainly think to Borland Pascal. Yes, it was a good idea from them. (Standard) Pascal has only "Succ" and "Pred". Applied to different contexts, both the "Inc" and the "idem" ideas would be useful for making programs readable and catch errors. In the example above, "Inc" is obviously the best. For "Inc", why not let the programmer define the procedure, the standard ensuring an "Intrinsic" pragma like for the Shift_Right function ? A set of "Inc", "Dec" (all scalar or floating types), "Add", "Sub", "Mul", "Div" (all numeric) would be nice. ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!