Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uiucdcsp!johnson From: johnson@uiucdcsp.cs.uiuc.edu Newsgroups: comp.lang.c++ Subject: Re: oo definition request Message-ID: <77300011@uiucdcsp> Date: 24 May 88 16:47:00 GMT References: <4800021@uiucdcsm> Lines: 20 Nf-ID: #R:uiucdcsm:4800021:uiucdcsp:77300011:000:1188 Nf-From: uiucdcsp.cs.uiuc.edu!johnson May 24 11:47:00 1988 A polymorphic procedure is one that takes arguments of many different types. There are several different kinds of polymorphism. ML features "parametric" polymorphism. (I hope I get all these names right.) C++ features "inclusive" polymorphism, where an instance of a subclass can be treated as if it were in a superclass. A type system for Smalltalk would have to treat "ad-hoc" polymorphism, which is where unrelated objects can all implement the same operation, but in entirely different ways. The question, "Which is more important in an object-oriented programming language, inheritance or message-passing?" is the same as saying "Which kind of polymorphism is most important, inclusive or ad-hoc"? Languages like Trellis/Owl show that ad-hoc polymorphism can be translated into inclusive polymorphism with multiple inheritance. If a procedure needs to be able to operate on objects in class A or class B then you can just define a common superclass to describe their commonality. On the other hand, parametric polymorphism is still needed even if the other two are allowed. For further information, see the paper by Cardelli and Wegner in Computing Surveys a few years ago.