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-04 18:29:47 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: aek@vib.usr.pu.ru (Alexander Kopilovitch) Newsgroups: comp.lang.ada Subject: Inc (was: Real data for a change in the assignment operators and Bounded_String discussions. ) Date: 4 Jul 2003 18:29:47 -0700 Organization: http://groups.google.com/ Message-ID: References: <3F04F778.5090305@attbi.com> NNTP-Posting-Host: 195.242.17.22 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1057368587 30060 127.0.0.1 (5 Jul 2003 01:29:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 5 Jul 2003 01:29:47 GMT Xref: archiver1.google.com comp.lang.ada:40069 Date: 2003-07-05T01:29:47+00:00 List-Id: Robert I. Eachus wrote: >Should Inc be predefined as a procudure? (In addition to as an >attribute function.) No. It is clearly easier to declare the version >of Inc that I want, than to remember where it is defined, what the >parameters are and so on. And I certainly don't want to discuss that in >ARG or WG9 meetings for something where the desired functionality fits >in one line. That's all fine, it would be sufficient to establish Standard Minimal Requirements for Ada (2005) textbooks, and require them to explain usefulness of Inc procedure -:) >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; I think Pascal language was aware of that even before Ada emerged. >But part of what makes it much clearer is having the definition of Inc >right there. And certainly any argument that > > Total +:= 1; -- or perhaps > Total := idem + 1; -- or whatever > >is "better" than: > > Inc(Total); > >is crazy. Certainly, Inc is much better here. But "idem" feature is not aimed for this case, it is for more complex formulae where cant'be anything so simple and universal like Inc. Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia