comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Two ideas for the next Ada Standard
Date: 1996/09/03
Date: 1996-09-03T00:00:00+00:00	[thread overview]
Message-ID: <Dx5zH4.2zo@world.std.com> (raw)
In-Reply-To: 50gelc$2le@goanna.cs.rmit.edu.au


In article <50gelc$2le@goanna.cs.rmit.edu.au>,
Richard A. O'Keefe <ok@goanna.cs.rmit.edu.au> wrote:
>This puzzles me greatly.  I've been hacking Ada for about two years now,
>and *except when trying to interface to C code* find that I have very
>few conversions. ...

I gave an example in another post.

Another example is: You can't write a function that takes a parameter of
"any integer type".  This is a perfectly reasonable thing to do -- e.g.
a function that converts an integer to a string.  (I know 'Image does
that, but it does it wrong -- it leaves an extra space, and it doesn't
support hexadecimal, interspersed commas (as in 1,000,000), etc.)

One choice is to write a function that takes Longest_Integer, or
whatever, but then you have a bunch of bogus type conversions at all the
call sites.  These type conversions are just extra verbiage in my
opinion.  A type conversion ought to tell the reader "I'm going outside
the type system, doing something questionable, read this carefully."
But if you have a lot of "harmless" type conversions, it weaken the
effect -- it's like crying wolf.

Another choice is to use a generic.  This require even *more* excess
verbiage (all kinds of instantiations).  And it can lead to code bloat
on most implementations.

Another choice is to declare a root integer type, and declare the
function as primitive of that type, and inherit that function for all
your integer types.  But this requires everything to be derived from a
single root type, which inhibits code reuse.

Another choice is to use subtypes instead of types.  This reduces the
number of type conversions needed, but also reduces the amount of type
checking.

>Hmm.  It would be interesting to determine the preferences of
> - people whose native language is SVO, like English
>    Prediction: subject.method(object) preferred.
>
> - people whose native language is VSO
>    Prediction:  method(subject, object) preferred
>
> - people whose native language is SOV (isn't Japanese like that?)
>    Prediction:  somewhere in between the others.

I doubt it.  Programming languages are so different from natural
languages that I don't believe the above predictions.  FWIW, I'm a
counter example (native language is English, but prefer method(args).
I suspect there's more cross-over from grade-school math notations to
programming notations, than from one's native language.

>To some extent this is true, but as someone who uses GNAT every day
>I don't want to see too much of Robert Dewar's time diverted from 
>enhancing an already *wonderful* tool.  And his postings are already
>darned productive (even when he disagrees with me).

I suspect he has two keyboards on his desk, and fixes bugs in GNAT with
his right hand, while simultaneously posting to comp.lang.ada with his
left hand.

- Bob




  parent reply	other threads:[~1996-09-03  0:00 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-31  0:00 Re:Two ideas for the next Ada Standard dulman
1996-09-01  0:00 ` Two " Robert Dewar
1996-09-01  0:00 ` Robert Dewar
1996-09-03  0:00   ` Jonas Nygren
1996-09-03  0:00     ` Richard A. O'Keefe
1996-09-03  0:00       ` Jonas Nygren
1996-09-03  0:00         ` Robert A Duff
1996-09-04  0:00         ` Robert Dewar
1996-09-04  0:00         ` Richard A. O'Keefe
1996-09-03  0:00       ` Robert A Duff [this message]
1996-09-03  0:00         ` Adam Beneschan
1996-09-03  0:00         ` Dale Stanbrough
1996-09-04  0:00           ` Two " Richard A. O'Keefe
1996-09-04  0:00         ` Robert Dewar
1996-09-04  0:00         ` Richard A. O'Keefe
1996-09-05  0:00           ` Robert A Duff
1996-09-06  0:00             ` Richard A. O'Keefe
1996-09-06  0:00               ` Robert Dewar
1996-09-10  0:00                 ` Richard A. O'Keefe
1996-09-10  0:00                   ` Robert Dewar
1996-09-10  0:00                   ` Mark A Biggar
1996-09-06  0:00               ` Robert A Duff
1996-09-05  0:00           ` Robert Dewar
1996-09-06  0:00             ` Richard A. O'Keefe
1996-09-10  0:00       ` Robert I. Eachus
1996-09-03  0:00     ` Peter Hermann
1996-09-04  0:00       ` Robert Dewar
1996-09-04  0:00         ` Larry Kilgallen
1996-09-04  0:00     ` Robert Dewar
1996-09-04  0:00     ` Robert Dewar
1996-09-03  0:00   ` Larry Kilgallen
1996-09-03  0:00   ` Jon S Anthony
1996-09-04  0:00     ` David Weller
1996-09-04  0:00     ` Joel VanLaven
1996-09-04  0:00   ` Jon S Anthony
1996-09-04  0:00     ` Robert A Duff
1996-09-04  0:00   ` Jonas Nygren
1996-09-06  0:00     ` Tucker Taft
1996-09-08  0:00     ` Jon S Anthony
1996-09-08  0:00       ` Robert Dewar
1996-09-09  0:00         ` John G. Volan
1996-09-09  0:00     ` Jon S Anthony
1996-09-04  0:00   ` Jon S Anthony
1996-09-05  0:00     ` Mark A Biggar
1996-09-05  0:00     ` Robert A Duff
1996-09-05  0:00   ` Robert I. Eachus
1996-09-06  0:00   ` Jon S Anthony
1996-09-07  0:00   ` Jonas Nygren
1996-09-08  0:00   ` Jon S Anthony
1996-09-08  0:00     ` Robert A Duff
1996-09-08  0:00   ` Jon S Anthony
1996-09-05  0:00 ` Jon S Anthony
1996-09-06  0:00 ` Jon S Anthony
1996-09-06  0:00 ` Jon S Anthony
1996-09-10  0:00 ` Samuel Tardieu
1996-09-10  0:00 ` Norman H. Cohen
1996-09-11  0:00 ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1996-09-06  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-09-04  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-09-06  0:00 ` Jon S Anthony
1996-09-04  0:00 Bob Mathis
1996-08-28  0:00 Two ideas for the next Ada standard Van Snyder
1996-08-29  0:00 ` Dale Stanbrough
1996-08-30  0:00   ` Robert A Duff
1996-08-30  0:00     ` Adam Beneschan
1996-08-31  0:00       ` Robert A Duff
1996-08-31  0:00         ` Robert Dewar
1996-09-04  0:00           ` Dennison
1996-09-05  0:00             ` Robert Dewar
1996-09-05  0:00               ` Dennison
1996-09-06  0:00                 ` Robert Dewar
1996-09-07  0:00                   ` Dennison
1996-09-07  0:00                     ` Robert Dewar
1996-09-06  0:00           ` Norman H. Cohen
1996-09-06  0:00             ` Robert A Duff
1996-09-06  0:00               ` Robert Dewar
1996-09-09  0:00               ` Norman H. Cohen
1996-09-06  0:00             ` Robert Dewar
1996-09-07  0:00             ` Keith Thompson
1996-09-12  0:00               ` Robert Dewar
1996-09-02  0:00         ` Geert Bosch
1996-09-02  0:00           ` Robert A Duff
1996-08-30  0:00 ` Peter Hermann
1996-08-30  0:00   ` Michael F Brenner
1996-08-30  0:00     ` Robert A Duff
1996-08-30  0:00       ` Robert Dewar
1996-08-31  0:00         ` Robert A Duff
1996-08-31  0:00           ` Robert Dewar
1996-09-01  0:00             ` Robert A Duff
1996-08-31  0:00   ` Robert Dewar
1996-09-01  0:00     ` Robert A Duff
1996-09-02  0:00 ` Laurent Guerby
1996-09-02  0:00   ` Robert Dewar
1996-09-03  0:00 ` Laurent Guerby
1996-09-03  0:00   ` Robert Dewar
1996-09-03  0:00 ` Laurent Guerby
1996-09-03  0:00   ` Robert Dewar
1996-09-04  0:00     ` Adam Beneschan
replies disabled

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