|[13 earlier articles]|
|Re: Polymorphism vs. Overloading email@example.com (Rob MacLachlan) (1994-10-25)|
|Re: Polymorphism vs. Overloading firstname.lastname@example.org (1994-10-31)|
|Re: Polymorphism vs. Overloading Mike.Chapman@muc.de (Mike Chapman) (1994-10-31)|
|Re: Polymorphism vs. Overloading email@example.com (1994-10-31)|
|Re: Polymorphism vs. Overloading firstname.lastname@example.org (1994-10-31)|
|Re: Polymorphism vs. Overloading email@example.com (1994-10-26)|
|Re: Polymorphism vs. Overloading firstname.lastname@example.org (1994-10-31)|
|Re: Polymorphism vs. Overloading email@example.com (1994-10-31)|
|Re: Polymorphism vs. Overloading firstname.lastname@example.org (Martin Odersky) (1994-10-31)|
|Re: Polymorphism vs. Overloading email@example.com (1994-10-27)|
|Re: Polymorphism vs. Overloading firstname.lastname@example.org (1994-10-28)|
|Re: Polymorphism vs. Overloading email@example.com (1994-10-28)|
|Re: Polymorphism vs. Overloading firstname.lastname@example.org (1994-10-29)|
|[11 later articles]|
|From:||email@example.com (Rene Dekker)|
|Organization:||Delft University of Technology|
|Date:||Mon, 31 Oct 1994 22:27:14 GMT|
Gabriela O. de Vivo <firstname.lastname@example.org> wrote:
email@example.com (Joseph H Allen) writes:
>Last week I was invited to join a Thesis (MsC) presentation.
>At some point a question raised about the exact difference between
>Polymorphism and Overloading.
You have overloading if MULTIPLE functions share a SINGLE
interface, each for a particular combination of parameter types.
You have polymorphism (in the strict sense) if a SINGLE function
has a single interface for MULTIPLE combinations of parameter types.
Note that inheritance in the OO sense can be seen as a combination of
overloading and polymorphism.
>The difference is purely syntactical. Calls to overloaded functions look,
>well, like function calls. Calls to polymorphic functions require a dot or
>'->' somewhere. Really, that's the only difference.
I don't know what you mean exactly by 'require a dot or -> somewhere',
but calls to overloaded functions need not be syntactically different
from calls to polymorphic functions. It might be that certain languages
require such a difference (I don't know of any).
>Next question: is there a difference between the functional language notion
>of a polymorphic type and inheritance (other than functional language type
>hierarchies being limited to one level)?
Mmm, this is tricky question, especially because the functional
language 'polymorphic type' and 'type hierarchy' are different notions,
and IMHO type-hierarchies need not be limited to one level.
The difference between a type-hierarchy and inheritance lies in
dynamic binding: type-hierarchies usually require the actual type to
be know at compile time, with inheritance the actual type can be
unknown until run time.
For more information on the different between polymorphism and
overloading, take a look at the exellent article:
author = "L. Cardelli and P. Wegner",
title = "On Understanding Types, Data Abstraction, and Polymorphism",
journal = "Computing Surveys",
volume = 17,
number = 4,
pages = "471-522",
year = 1985
Rene Dekker Delft University of Technology
R.Dekker@twi.tudelft.nl Department of Technical Mathematics and Informatics
Tel: +3115 783850 Julianalaan 132
Fax: +3115 787141 2628 BL Delft, The Netherlands
Return to the
Search the comp.compilers archives again.