home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / object / 4995 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  3.3 KB

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