comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: C vs. Ada - strings
Date: 2000/05/22
Date: 2000-05-22T00:00:00+00:00	[thread overview]
Message-ID: <wccr9auk6ci.fsf@world.std.com> (raw)
In-Reply-To: 8g8p31$a2s$1@nnrp1.deja.com

Robert Dewar <robert_dewar@my-deja.com> writes:

> In article <wcc8zx7ua2y.fsf@world.std.com>,
>   Robert A Duff <bobduff@world.std.com> wrote:
> > So is the verbose
> > syntax.  Why can't you say X'Image instead of
> Integer'Image(X)?
> 
> Note that GNAT provides the attribute Img, which can be used
> precisely in this manner (e.g. X'Img instead of
> Integer'Image (X)). Very useful for simple debug output

Yes, of course, I anticipated that you would mention GNAT's 'Img -- to
the point where I have already written a reply in my head.  ;-)

Of course the main drawback is that 'Img is not standard.
If you don't care about that, then 'Img is fine.

My other (minor) complaint is that Img is an ugly abbreviation for
Image.  Robert will reply that it's standard Ada style to use
abbreviations for attribute names.  And I will reply that that's true,
but it's not standard Ada style to use *ugly* abbreviations for
attribute names.  ;-) I'm not allergic to abbreviations for commonly
used things: 'Pred is OK because (1) there's precedent (from Pascal) so
folks are used to it, (2) it's a prefix, (3) it's pronouncable, (4) it's
unlikely to cause confusion, and (5) there's a high payoff in terms of
how much less code you have to read ("Pred" vs "Predecessor").  'Img, on
the other hand, abbreviates by leaving out all the vowels, something
which I find uncivilized, compared to using a prefix of the word.  And
it only saves two letters.

Of course, GNAT has no choice -- it would be illegal to call it 'Image,
and 'Img is the obvious alternative.

Oh, one other thing: 'Img, being a GNAT invention, *could* have
eliminated the annoying extra blank.  Why didn't you?

- Bob




  reply	other threads:[~2000-05-22  0:00 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-02  0:00 C vs. Ada - strings Wes Groleau
2000-05-02  0:00 ` Larry Kilgallen
2000-05-02  0:00 ` Ted Dennison
2000-05-03  0:00   ` Wes Groleau
2000-05-03  0:00     ` Ted Dennison
2000-05-03  0:00   ` Pascal Obry
2000-05-03  0:00     ` Keith Thompson
2000-05-04  0:00       ` Wes Groleau
2000-05-18  0:00       ` Pete
2000-05-18  0:00         ` dale
2000-05-18  0:00           ` Robert A Duff
2000-05-19  0:00             ` dale
2000-05-21  0:00             ` Robert Dewar
2000-05-22  0:00               ` Robert A Duff [this message]
2000-05-22  0:00                 ` Keith Thompson
2000-05-24  0:00                 ` 'img Peter Hermann
2000-05-24  0:00                   ` 'img Robert Dewar
2000-05-24  0:00                     ` 'img Ted Dennison
2000-05-25  0:00                       ` 'img Robert Dewar
2000-05-25  0:00                       ` 'img Peter Hermann
2000-05-25  0:00                         ` 'img Keith Thompson
2000-05-25  0:00                           ` 'img Ted Dennison
2000-05-26  0:00                         ` 'img dmitry
2000-05-26  0:00                           ` 'img Brian Rogoff
2000-05-26  0:00                             ` 'img Robert Dewar
2000-05-26  0:00                           ` 'img Robert Dewar
2000-05-19  0:00         ` C vs. Ada - strings Geoff Bull
2000-05-19  0:00           ` mike
2000-05-21  0:00           ` Robert Dewar
2000-06-03  0:00           ` Pete
2000-06-03  0:00             ` Ken Garlington
2000-06-03  0:00               ` Ted Dennison
2000-06-04  0:00                 ` Ken Garlington
2000-06-04  0:00                 ` Dale Stanbrough
2000-06-03  0:00             ` Java vs. Ada - strings (was: C vs. Ada - strings) Ted Dennison
2000-06-04  0:00               ` Robert I. Eachus
2000-06-04  0:00               ` Pete
2000-06-04  0:00                 ` Jean-Pierre Rosen
2000-06-04  0:00                   ` Pete
2000-06-05  0:00                     ` Jean-Pierre Rosen
2000-06-05  0:00                 ` Ted Dennison
2000-06-05  0:00                   ` Marin D. Condic
2000-06-05  0:00                     ` David Botton
2000-06-05  0:00                       ` Marin D. Condic
2000-06-06  0:00                     ` Robert A Duff
2000-06-06  0:00                   ` Ken Garlington
2000-06-06  0:00                     ` Marin D. Condic
2000-05-04  0:00   ` C vs. Ada - strings Ole-Hjalmar Kristensen
2000-05-04  0:00     ` Gautier
2000-05-02  0:00 ` Robert A Duff
2000-05-03  0:00   ` Wes Groleau
2000-05-03  0:00     ` Tarjei Tj�stheim Jensen
2000-05-03  0:00       ` Ted Dennison
2000-05-03  0:00   ` Tarjei T. Jensen
2000-05-03  0:00     ` Charles Hixson
2000-05-04  0:00     ` Robert Dewar
2000-05-04  0:00       ` Charles Hixson
2000-05-06  0:00       ` Tarjei Tj�stheim Jensen
2000-05-04  0:00   ` Robert Dewar
2000-05-04  0:00     ` Robert A Duff
2000-05-04  0:00       ` Robert Dewar
2000-05-05  0:00         ` Florian Weimer
2000-05-05  0:00           ` Pascal Obry
2000-05-05  0:00             ` Hyman Rosen
2000-05-06  0:00           ` Tarjei Tj�stheim Jensen
2000-05-06  0:00             ` Florian Weimer
2000-05-07  0:00               ` Robert Dewar
2000-05-09  0:00                 ` Florian Weimer
2000-05-04  0:00     ` Hyman Rosen
2000-05-04  0:00       ` Jon S Anthony
2000-05-04  0:00       ` Robert Dewar
2000-05-05  0:00 ` Florian Weimer
2000-05-05  0:00   ` Ted Dennison
2000-05-05  0:00   ` Robert Dewar
replies disabled

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