Related articles |
---|
[5 earlier articles] |
Polymorphism vs. Overloading nandu@cs.clemson.edu (1994-10-27) |
Re: Polymorphism vs. Overloading norman@flaubert.bellcore.com (1994-10-24) |
Re: Polymorphism vs. Overloading ichudov@wiltel.com (1994-10-28) |
Re: Polymorphism vs. Overloading strohm@mksol.dseg.ti.com (1994-10-28) |
Re: Polymorphism vs. Overloading ryer@dsd.camb.inmet.com (1994-10-28) |
Re: Polymorphism vs. Overloading mac@coos.dartmouth.edu (1994-10-25) |
Re: Polymorphism vs. Overloading joe@sanskrit.ho.att.com (1994-10-31) |
Re: Polymorphism vs. Overloading geld@cs.sun.ac.za (1994-10-31) |
Re: Polymorphism vs. Overloading ram@cs.cmu.edu (Rob MacLachlan) (1994-10-25) |
Re: Polymorphism vs. Overloading billk@cs.ukans.edu (1994-10-31) |
Re: Polymorphism vs. Overloading Mike.Chapman@muc.de (Mike Chapman) (1994-10-31) |
Re: Polymorphism vs. Overloading jsm@id.dth.dk (1994-10-31) |
Re: Polymorphism vs. Overloading sofkam@rpi.edu (1994-10-31) |
[19 later articles] |
Newsgroups: | comp.compilers |
From: | joe@sanskrit.ho.att.com (Joe Orost) |
Keywords: | polymorphism |
Organization: | AT&T |
References: | 94-10-144 94-10-154 |
Date: | Mon, 31 Oct 1994 22:14:49 GMT |
Gabriela O. de Vivo <gdevivo@conicit.ve> wrote:
>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.
I just learned this in class from Professor Borgida (borgida@cs.rutgers.edu):
Types of polymorphism:
o Ad-hoc/overloading: One function name can be associated with several bodies,
distinguished by the type of arguments passed to the function (and sometimes
the type of the result). [c++, CLU, Ada, Pascal I/O, {+, -, * /} in
{ML, C, FORTRAN}]. It is resolved completely at compile time. Example:
put(0); put("hello"); put(1.0); calls three different "put" procedures.
o Parametric polymorphism/"genericity": Same source code generates multiple
copies of object code, one for each instance. [\-calculus: /\t, ML, CLU,
Ada generics, c++ templates]. Examples: generic linked lists, generic sort.
o Subtype polymorphism: Same run-time code operates on different types.
(The types all partially share the same representation). [Smalltalk/c++ class
heirarchy, range subtypes in pascal/Ada, derived types in Ada]. Example:
Operations of type PERSON being applied to an object of type STUDENT.
regards,
joe
--
Full Name: Joseph M. Orost
EMail: joe@babel.ho.att.com, attmail!orost, orost@paul.rutgers.edu
Organization: AT&T Bell Laboratories: FlashPort Services
SurfaceMail: 943 Holmdel Rd.; Cruz Plaza; Holmdel, NJ 07733
Phone: +1 (908) 946-1115
Fax: +1 (908) 946-9146
WWW: http://paul.rutgers.edu/~orost
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.