comp.lang.ada
 help / color / mirror / Atom feed
From: Dave Thompson <david.thompson1@worldnet.att.net>
Subject: Re: Typing in Ada
Date: Thu, 10 Jun 2004 03:00:41 GMT
Date: 2004-06-10T03:00:41+00:00	[thread overview]
Message-ID: <au1dc0lu1i0ssubggal6pa9t7934fp45c8@4ax.com> (raw)
In-Reply-To: Xns94FAD7427C148pchapinsovernet@207.106.92.237

On Tue, 01 Jun 2004 01:09:41 GMT, "Peter C. Chapin"
<pchapin@sover.net> wrote:

> tmoran@acm.org wrote in news:_KOuc.24339$IB.6225@attbi_s04:
> 
> >   How would you do in C the equivalent of
<snip>
> Are you asking me to show you symbolic polynomical manipulation code in C? 
> I don't understand how that bears on the question of how strongly typed C 
> is. In any case your example uses features like generic instantiation and 
> operator overloading that could be more directly mapped to C++. Would you 
> say that C++ is more strongly typed than C?
> 
Slightly. In C enum types simply are integer types; in C++ they are
distinct, though it will silently convert an enum _to_ an integer (not
the reverse). And C++ makes character literals type char instead of
type int, so overloading on that type has some hope of being usable. 
(Although char still is, and promotes as, an integer type.)

And it does not allow silent conversions _from_ pointer-to-void (which
is the moral equivalent of System.Address) to other (data) pointers.
(This is actually a specific case of not allowing conversions "down"
the class hierarchy, which in general does not apply to C.)

And finally, though people don't always think of it as typing, C++
requires the "new" style declaration of routines/methods with
parameters specified so calls, and pointers-to-function (and pmfs) if
used, can be fully checked*; C supports this but also allows the old
K&R1 FORTRANish function-of-you-must-know-the-args. For that matter,
C++ and C99, unlike C89 and earlier, no longer have implicit
declarations of functions, as taking unspecified arguments and
returning int; this isn't really a typing issue, as an implicitly
declared function actually has the same type, and gets the same
(limited) checking, as an equivalent explicit declaration, but lack of
a visible, checkable, and modifiable declaration makes it seem so.

* except for varargs -- and C++ default arguments and overloading
allow better alternatives in many cases to varargs.

- David.Thompson1 at worldnet.att.net



  parent reply	other threads:[~2004-06-10  3:00 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-31 13:32 Typing in Ada Empit
2004-05-31 14:04 ` Poul-Erik Andreasen
2004-05-31 17:01 ` Jeffrey Carter
2004-05-31 20:03   ` Peter C. Chapin
2004-05-31 22:56     ` tmoran
2004-06-01  1:09       ` Peter C. Chapin
2004-06-01  4:40         ` tmoran
2004-06-01 11:26           ` Peter C. Chapin
2004-06-10  3:01             ` Dave Thompson
2004-06-10  3:00         ` Dave Thompson [this message]
2004-05-31 23:22     ` Nick Roberts
2004-06-01  1:04       ` Peter C. Chapin
2004-06-01  2:29         ` Nick Roberts
2004-06-02  4:39         ` Robert I. Eachus
2004-06-02 15:17           ` Hyman Rosen
2004-06-01  2:36       ` Hyman Rosen
2004-06-01  4:27         ` Larry Kilgallen
2004-06-01  4:05           ` Hyman Rosen
     [not found]         ` <d4vnb0tepd4togdrvdrbqpok1ne6n9i2vp@4ax.com>
2004-06-01 14:36           ` Wes Groleau
2004-06-01 20:24         ` Niklas Holsti
2004-06-02  4:43           ` Wes Groleau
2004-06-02  5:28             ` Robert I. Eachus
2004-06-02  8:19               ` tmoran
2004-06-02 14:47               ` Wes Groleau
2004-06-02 11:26             ` Marin David Condic
2004-06-02 14:54               ` gratuitous restrictions (was:Typing in Ada) Wes Groleau
2004-06-02  5:04           ` Typing in Ada Robert I. Eachus
2004-06-01  2:14     ` David C. Hoos
2004-06-02  1:30     ` Jeffrey Carter
2004-06-02 10:53       ` Peter C. Chapin
2004-06-02 11:38         ` Marin David Condic
2004-06-17  2:50           ` Dave Thompson
2004-06-17  4:24             ` James Rogers
2004-06-17 12:28               ` Hyman Rosen
2004-06-17 23:42                 ` James Rogers
2004-06-20 11:27                   ` Nick Roberts
2004-06-20 23:29                     ` new revision ada Brian May
2004-06-21  2:16                       ` tmoran
2004-06-21  2:34                         ` James Rogers
2004-06-22  2:16                           ` Roland Illig
2004-06-22  3:41                             ` James Rogers
2004-06-22  6:53                               ` Martin Krischik
2004-06-21 23:33                         ` Brian May
2004-06-22 20:26                           ` Simon Wright
2004-06-23  0:50                             ` Larry Elmore
2004-06-22 22:06                           ` tmoran
2004-06-21  5:31                       ` Wes Groleau
2004-06-21 12:27                       ` new revision ada (limited with, excpetion handling) Nick Roberts
2004-06-21 13:04                         ` Martin Dowie
2004-06-22 10:38                       ` new revision ada Georg Bauhaus
2004-06-22 12:45                         ` James Rogers
2004-06-22 15:17                           ` Martin Krischik
2004-06-22 16:09                             ` new revision ada (exception handling) Nick Roberts
2004-06-23  7:55                               ` Pascal Obry
2004-06-23  8:40                                 ` Martin Krischik
2004-06-23 19:33                                   ` Randy Brukardt
2004-06-24  6:57                                     ` Martin Krischik
2004-06-24 21:13                                       ` Randy Brukardt
2004-06-25  8:05                                         ` Dmitry A. Kazakov
2004-06-25 17:28                                           ` Randy Brukardt
2004-06-23  4:31                             ` new revision ada Brian May
2004-06-23 19:47                               ` Randy Brukardt
2004-06-22 16:37                           ` Georg Bauhaus
2004-06-26 14:57                           ` Robert I. Eachus
2004-06-01  1:02 ` Typing in Ada Alexander E. Kopilovich
  -- strict thread matches above, loose matches on Subject: below --
2004-06-01  2:11 David C. Hoos, Sr.
2004-06-01  2:13 David C. Hoos, Sr.
replies disabled

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