Re: Defining polymorphism vs. overloading

ok@goanna.cs.rmit.OZ.AU (Richard A. O'Keefe)
7 Sep 90 08:57:46 GMT

          From comp.compilers

Related articles
[6 earlier articles]
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)
Re: Defining polymorphism vs. overloading pase@orville.nas.nasa.gov (1990-09-06)
Re: Defining polymorphism vs. overloading tub!wg@relay.EU.net (1990-09-06)
Re: Defining polymorphism vs. overloading pase@orville.nas.nasa.gov (Douglas M. Pase) (1990-09-06)
Re: Defining polymorphism vs. overloading ok@goanna.cs.rmit.OZ.AU (1990-09-07)
Re: Defining polymorphism vs. overloading pardo@cs.washington.edu (1990-09-07)
Re: Defining polymorphism vs. overloading pardo@cs.washington.edu (1990-09-07)
Re: Defining polymorphism vs. overloading mmengel@cuuxb.ATT.COM (1990-09-11)
Re: Defining polymorphism vs. overloading freek@fwi.uva.nl (1990-09-10)
Re: Defining polymorphism vs. overloading pcg@cs.aber.ac.uk (Piercarlo Grandi) (1990-09-13)
Re: Defining polymorphism vs. overloading voss@suna0.cs.uiuc.edu (1990-09-14)
[4 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: ok@goanna.cs.rmit.OZ.AU (Richard A. O'Keefe)
Keywords: polymorphism, design
Organization: Comp Sci, RMIT, Melbourne, Australia
References: <9008310419.AA06194@karakorum.berkeley.edu> <2509@l.cc.purdue.edu>
Date: 7 Sep 90 08:57:46 GMT

In article <2509@l.cc.purdue.edu>, hrubin@l.cc.purdue.edu (Herman Rubin) writes:
> In article <BURLEY.90Sep1013113@world.std.com>, burley@world.std.com (James C Burley) writes:
> > 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)....
> > o Polymorphism means using the same piece of code to operate on objects
> > of different types.


Let me summarise that:
DIFFERENT code for different types => OVERLOADING
SAME code for different types => POLYMORPHISM
(ignoring implementation detail; the SELF compiler will compile different
versions of what's _conceptually_ the same code.)
They are means to different ends.


> Thus if y and z are long integers, this becomes (different assembler languages
> have somewhat different notation, and this may not correspond to any)
> ADDL y,z
> and if they are floating
> ADDF y,z


This sounds like _different_ code for the different types, so overloading.


> Now ADDL and ADDF will operate on either, so those are polymorphic and
> not overloaded.


And now I am completely lost. The NS32?32 has addd (equivalent of ADDL)
and addf (equivalent of ADDF) and they _won't_ operate on either, they
are very specific. Same for every machine I've ever used except the
B6700 and Xerox Lisp machine (both of which have _one_ polymorphic add).


--
[Herman's definition does seem to be the reverse of the one favored by
other people. -John]




--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.