Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.c++,comp.lang.misc
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!news.moneng.mei.com!daily-planet.execpc.com!spool.mu.edu!howland.reston.ans.net!xlink.net!slsv6bt!news
From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763)
Subject: Re: Types, types: static vs. dynamic -- classification
In-Reply-To: shang@corp.mot.com's message of Thu, 21 Sep 1995 21:37:34 GMT
Message-ID: <KANZE.95Sep25170254@slsvhdt.lts.sel.alcatel.de>
Lines: 38
Sender: news@lts.sel.alcatel.de
Organization: SEL
References: <BLUME.95Sep18171508@salomon.cs.princeton.edu>
	<1995Sep21.213734.1114@schbbs.mot.com>
Date: 25 Sep 1995 16:02:54 GMT
Xref: glinda.oz.cs.cmu.edu comp.object:38644 comp.lang.smalltalk:28672 comp.lang.c++:150632 comp.lang.misc:23135

In article <1995Sep21.213734.1114@schbbs.mot.com> shang@corp.mot.com
(David L. Shang) writes:

|> In article <BLUME.95Sep18171508@salomon.cs.princeton.edu>  
|> blume@salomon.cs.princeton.edu (Matthias Blume) writes:
|> > In article <1995Sep18.150021.7594@schbbs.mot.com> shang@corp.mot.com (David  
|> L. Shang) writes:
|> > 
|> > 	     Dynamically typed is often refered to poly-
|> > 	     morphism.
|> > 
|> > And wrongly so.  SML, for example, is statically typed and uses a
|> > polymorphic type system.   These two things are not the same.

|> As I said, each type system or particular language has its
|> own definition. I am not going to argue with you what name
|> should be used for what definition.

|> The majority of static OO langauges including C++, Eiffel, Sather,
|> Beta, Modula-3, Ada95, etc, use polymorphism in the case which
|> I described as dynamically typed variables or parameters.

Actually, C++ has both static and dynamic polymorphism.  The static
polymorphism is implemented using templates, and the dynamic using
virtual functions.  Thus, for example, the STL function ``sort'' is
polymorphic, although the polymorphism is resolved at compile time
(staticly). 

On the other hand, it is true that in general, when a C++ program
speaks of polymorphism, or a polymorphic object, he is almost always
speaking of dynamic polymorphism.
-- 
James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                              -- Beratung in industrieller Datenverarbeitung


