home *** CD-ROM | disk | FTP | other *** search
- From: kers@hplb.hpl.hp.com (Chris Dollin)
- Date: Fri, 22 Jan 1993 10:11:55 GMT
- Subject: Re: Re: FAQ Part 1 (of 2) [ polymorphism or latent typing? ]
- Message-ID: <KERS.93Jan22101155@cdollin.hpl.hp.com>
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- Path: sparky!uunet!usc!sdd.hp.com!hpscit.sc.hp.com!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
- Newsgroups: comp.object
- References: <1993Jan13.061114.18430@netcom.com> <PCG.93Jan20002119@decb.aber.ac.uk> <1993Jan22.004420.16674@netcom.com>
- Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
- Lines: 57
- In-Reply-To: Bob Hathaway's message of Fri, 22 Jan 1993 00:44:20 GMT
- Nntp-Posting-Host: cdollin.hpl.hp.com
-
- In article ...Bob Hathaway <objsys@netcom.com> writes:
-
- Since Strachey defined parametrically polymorphic
- functions (functions parameterized by objects of different types), the
- formal parameters assume many forms and can be referred to as polymorphic.
-
- Yes; and formal parameters are not objects. (Digression to meta-discussion
- about how the compiler might treat the code would be irrelevant.)
-
- Most static OO languages equate polymorphism with dynamic
- binding. For instance in the C++ ARM (p209): "... the ability to call
- a variety of functions using exactly the same interface - as is provided
- by virtual functions - is sometimes called polymorphism."
-
- Yes; that's *inclusion polymorphism*, where a parameter of type *T can be a
- pointer to a T' which is a subtype of T. ``Dynamic binding'' (a term which has
- changed its meaning over the past few years, I note) is a way of implementing
- inclusion polymorphism.
-
- In this third-level text
-
- >objsys> In a nutshell, polymorphism is the ability of an object to be a
- >objsys> placeholder (or formal object) for many different objects, and
- >objsys> for that formal object to behave differently based on the actual
- >objsys> object present.
-
- I suspect you are confusing the notion of *object* (the things a program talks
- about and manipulates) with that of *variable* (the ways through which it gets
- at the objects). When you then say:
-
- Most modern languages (I already gave references)
- use polymorphism to refer to the ability of an object to assume (or be
- assigned to) many different forms of objects (Meyer is quite clear on this),
-
- where Meyer seems (to me) to be quite clear that it is *entities* that do the
- referring, not objects, my suspicion grows stronger.
-
- True, but the classical OO definition of polymorphism, or what Booch
- simply defines as polymorphism [Booch 91, p517] is: "A concept in type
- theory, according to which a name (such as a variable declaration) may
- denote objects of many different classes that are related by some common
- superclass; thus, any object denoted by this name is able to respond to
- some common set of operations in different ways."
-
- And in this definition, it is the *name* which may denote objects of many
- different (related) classes. So when you say:
-
- I think you're the one inflicting confusing terminology. Everyone in recent
- history seems to define polymorphism as a property of objects (Stroustrup,
- Meyer, Booch, ...)
-
- I think this is because you have conflated the notions of ``objects'' and
- ``variable'' (or reference, or pointer, or whatever).
- --
-
- Regards, | "You're better off not dreaming of the things to come;
- Kers. | Dreams are always ending far too soon." - Caravan.
-