comp.lang.ada
 help / color / mirror / Atom feed
From: aek@vib.usr.pu.ru (Alexander Kopilovitch)
Subject: Inc (was: Real data for a change in the assignment operators and Bounded_String discussions. )
Date: 4 Jul 2003 18:29:47 -0700
Date: 2003-07-05T01:29:47+00:00	[thread overview]
Message-ID: <e2e5731a.0307041729.6fb682a6@posting.google.com> (raw)
In-Reply-To: 3F04F778.5090305@attbi.com

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



  reply	other threads:[~2003-07-05  1:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-04  3:41 Real data for a change in the assignment operators and Bounded_String discussions Robert I. Eachus
2003-07-05  1:29 ` Alexander Kopilovitch [this message]
2003-07-07 21:31   ` Inc (was: Real data for a change in the assignment operators and Bounded_String discussions. ) Gautier Write-only
2003-07-07 21:35     ` Inc (was: Real data for a change in the assignment operators and Larry Kilgallen
2003-07-08  3:53       ` Gautier Write-only
2003-07-08 20:50       ` Alexander Kopilovitch
2003-07-07 21:42     ` Inc (was: Real data for a change in the assignment operators and Bounded_String discussions. ) Vinzent Hoefler
2003-07-08  4:04       ` Gautier Write-only
2003-07-07  4:27 ` Real data for a change in the assignment operators and Bounded_String discussions Hyman Rosen
2003-07-07  9:27   ` Georg Bauhaus
2003-07-07  9:41     ` Georg Bauhaus
2003-07-07 14:29       ` Hyman Rosen
2003-07-07 17:29         ` Georg Bauhaus
2003-07-07 19:01           ` Hyman Rosen
2003-07-07 15:49       ` Robert I. Eachus
2003-07-07 13:46     ` Hyman Rosen
2003-07-07 16:03       ` Robert I. Eachus
2003-07-07 18:52         ` Hyman Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox