Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!rutgers!rochester!rit!mjl From: mjl@cs.rit.edu Newsgroups: comp.object Subject: Re: "Ad Hoc Polymorphism" -- I'm Quoting Someone Else Keywords: ad hoc polymorphism, reference to original use Message-ID: <1514@cs.rit.edu> Date: 9 Jan 90 14:20:28 GMT References: <646@ajpo.sei.cmu.edu> Sender: news@cs.rit.edu Reply-To: mjl@prague.UUCP (Michael Lutz) Organization: Rochester Institute of Technology, Rochester, NY Lines: 53 In article <646@ajpo.sei.cmu.edu> eberard@ajpo.sei.cmu.edu (Edward Berard) writes: >Jim Adcock has admonished me as follows: > > "Can you please choose some other descriptor rather than "ad > hoc polymorphism" ??? This term is not descriptive, is being > applied to a technique that is certainly *not* "ad hoc," and > sounds like it is intended to be prejudicial terminology -- > which I'm sure was not your intent!" > >If you recognize this type of polymorphism as having a different name, >and can cite two, or more, earlier references, I will consider using >a different name. (Heck! I'll even take _one_ earlier reference. ;-)) I doubt such a reference will be found, as the original use of the phrase "ad-hoc polymorphism" is from Christopher Strachey ("Fundamental concepts in programming languages." Lecture Notes for the International School in Computer Programming, Copenhagen, Aug. 1967). Note the date: well before the first Smalltalk system, and coterminal with the introduction of Simula. I don't have the original handy, but I do have a second hand source, the paper "On Understanding Types, Data Abstraction, and Polymorphism", by Peter Wegner and Luca Cardelli, ACM Computing Surveys, December 1985. To quote from this paper (p. 475): Strachey distinguished, informally, between two major kinds of polymorphism. *Parametric polymorphism* is obtained when a function works uniformly on a range of types; these types normally exhibit some common structure. *Ad-hoc polymorphism* is obtained when a function works, or appears to work, on several different types (which may not exhibit a common structure) and may behave in unrelated ways for each type. [If Strachey was not using ad-hoc polymorphism as a pejorative, he certainly considered such polymorphism unseemly :-) mjl] Wegner and Cardelli then define a new form of polymorphism, *inclusion polymorphism*, to handle inheritance. They group both parametric and inclusion polymorphism under a superclass universal polymorphism, because they both achieve a uniform type structure. By way of contrast, coercion and overloading are forms of non-uniform, ad-hoc polymorphism. [A classic example is overloading "+" on strings to mean catenation - mjl] I strongly recommend this paper to those interested in a deeper appreciation of the issues surrounding the notion of "type". Mike Lutz Rochester Institute of Technology mjl@cs.rit.edu rutgers!rochester!rit!mjl Mike Lutz Rochester Institute of Technology, Rochester NY UUCP: {rutgers,cornell}!rochester!rit!mjl INTERNET: mjlics@ultb.isc.rit.edu