Related articles |
---|
Defining polymorphism vs. overloading oliver@karakorum.berkeley.edu (1990-08-30) |
Re: Defining polymorphism vs. overloading burley@world.std.com (1990-09-01) |
Re: Defining polymorphism vs. overloading wright@gefion.rice.edu (1990-09-02) |
Re: Defining polymorphism vs. overloading compilers-sender@esegue.segue.boston.ma.us (1990-09-03) |
Re: Defining polymorphism vs. overloading hrubin@l.cc.purdue.edu (1990-09-03) |
Re: Defining polymorphism vs. overloading px@fctunl.rccn.pt (1990-09-03) |
Re: Defining polymorphism vs. overloading plph@caen.engin.umich.edu (1990-09-03) |
Re: Defining polymorphism vs. overloading daveg@near.cs.caltech.edu (1990-09-03) |
Re: Defining polymorphism vs. overloading dmw9q@uvacs.cs.Virginia.EDU (1990-09-05) |
[14 later articles] |
Newsgroups: | comp.compilers |
From: | wright@gefion.rice.edu (Andrew Wright) |
Keywords: | design, polymorphism |
Organization: | Rice University, Houston |
References: | <9008310419.AA06194@karakorum.berkeley.edu> |
Date: | Sun, 2 Sep 90 22:00:39 GMT |
In article <9008310419.AA06194@karakorum.berkeley.edu> oliver@karakorum.berkeley.edu (Oliver Sharp) writes:
> o Overloading means using the same name (or symbol) to invoke different
> code depending on the types of the arguments (or operands). So, an example
> ...
> o Polymorphism means using the same piece of code to operate on objects of
> different types. In LISP, cons is polymorphic because you can give it
> arguments of different types but it goes ahead and does its thing without
> worrying about it.
C. Strachey originated the terms "ad-hoc" and "universal" polymorphism
to distinguish these issues. overloading is an example of ad-hoc polymorphism,
automatic coercions such as real->int are another.
ML is the best example of universal polymorphism (what you call simply
polymorphism above). See:
@article{Cardelli86,
author = "Luca Cardelli and Peter Wegner",
year = "1985",
month = "December",
journal = "ACM Computing Surveys",
volume = "17",
number = "4",
pages = "471-522",
title = "On Understanding Types, Data Abstraction, and Polymorphism"
}
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.