comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: STL, Ada, C++ (Was Re: The Next Microsoft?)
Date: 2000/05/08
Date: 2000-05-08T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0005081534330.24665-100000@shell5.ba.best.com> (raw)
In-Reply-To: t7og6gahgm.fsf@calumny.jyacc.com

On 8 May 2000, Hyman Rosen wrote:
> Robert Dewar <robert_dewar@my-deja.com> writes:
> > I am not at all convinced that automatic instantiation is
> > a help to the reader and maintainer, on the contrary, it
> > seems very awkward to have uses of templates not be visible
> > from this point of view.
> 
> I consider automatic instantiation of templates to be the compile-time
> polymorphism equivalent of run-time dispatching on class-wide types.

Correct, and type theorists refer to this as "parametric polymorphism". 
Ada doesn't really have parametric polymorphism, it's generics are really 
monomorphic. 

> When you make a dispatching call, you do not know what function you
> are calling. Similarly, you should be able to call a generic function
> without explicitly stating which one you are calling.

This is one good way to look at it, since dispatching is sometimes a 
negative with respect to readability and maintainability. It is also 
similar to overloading; if you have several overloaded functions in scope 
you don't explicitly say which you are calling in Ada or C++. In languages 
without overloading you have to use qualified names. 

As much as I like Ada, this is one thing I really prefer about the C++
design. This discussion might be more interesting with specific examples,
so I'll put some together in an Ada-like language with automatic
instantiation. Shen and Cormack's paper from Tri-Ada 91 is a good place to 
start for anyone interested.

-- Brian






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

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8eg37k$15n$1@nnrp1.deja.com>
     [not found] ` <8epkoa$b8b$1@nnrp1.deja.com>
     [not found]   ` <E$OcUgAHHIE5Ewfl@quik.freeuk.net>
     [not found]     ` <8eu0ob$7qv$1@nnrp1.deja.com>
2000-05-05  0:00       ` The Next Microsoft? Ray Blaak
2000-05-05  0:00         ` Mark Atwood
2000-05-05  0:00           ` Hyman Rosen
2000-05-05  0:00             ` Mark Atwood
2000-05-05  0:00               ` Hyman Rosen
2000-05-05  0:00                 ` Jon S Anthony
2000-05-05  0:00                   ` Hyman Rosen
2000-05-05  0:00                     ` Jon S Anthony
2000-05-05  0:00                     ` Bill Greene
2000-05-06  0:00                       ` Ehud Lamm
2000-05-07  0:00                       ` STL, Ada, C++ (Was Re: The Next Microsoft?) Brian Rogoff
2000-05-08  0:00                         ` Florian Weimer
2000-05-08  0:00                         ` Robert Dewar
2000-05-07  0:00                           ` Brian Rogoff
2000-05-08  0:00                           ` Hyman Rosen
2000-05-08  0:00                             ` Brian Rogoff [this message]
2000-05-09  0:00                             ` Richard D Riehle
2000-05-09  0:00                               ` Brian Rogoff
2000-05-09  0:00                                 ` Hyman Rosen
2000-05-09  0:00                                   ` Robert A Duff
2000-05-09  0:00                                     ` Hyman Rosen
2000-05-09  0:00                                 ` Brian Rogoff
2000-05-10  0:00                                 ` Richard D Riehle
2000-05-10  0:00                                   ` Brian Rogoff
2000-05-08  0:00                           ` Pascal Obry
2000-05-08  0:00                             ` Brian Rogoff
2000-05-08  0:00                               ` Robert Dewar
2000-05-08  0:00                                 ` Pascal Obry
2000-05-09  0:00                                 ` STL, Ada, C++ Harry Erwin
2000-05-09  0:00                                   ` Robert A Duff
2000-05-09  0:00                               ` STL, Ada, C++ (Was Re: The Next Microsoft?) Marin D. Condic
2000-05-09  0:00                                 ` Robert Dewar
2000-05-09  0:00                                   ` Marin D. Condic
2000-05-05  0:00           ` The Next Microsoft? Ayende Rahien
2000-05-05  0:00         ` Bobby D. Bryant
replies disabled

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