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

  1. Path: sparky!uunet!pipex!unipalm!uknet!gdt!aber!fronta.aber.ac.uk!pcg
  2. From: pcg@aber.ac.uk (Piercarlo Grandi)
  3. Newsgroups: comp.object
  4. Subject: Re: FAQ  Part 1 (of 2) [ a bit of polemic ]
  5. Message-ID: <PCG.93Jan25215042@decb.aber.ac.uk>
  6. Date: 25 Jan 93 21:50:42 GMT
  7. References: <PCG.93Jan14154212@decb.aber.ac.uk> <1993Jan15.033713.27130@netcom.com>
  8.     <PCG.93Jan19231409@decb.aber.ac.uk> <1993Jan21.024452.6
  9.     <KERS.93Jan21100655@cdollin.hpl.hp.com>
  10. Sender: news@aber.ac.uk (USENET news service)
  11. Reply-To: pcg@aber.ac.uk (Piercarlo Grandi)
  12. Organization: Prifysgol Cymru, Aberystwyth
  13. Lines: 49
  14. In-Reply-To: kers@hplb.hpl.hp.com's message of 21 Jan 93 10: 06:55 GMT
  15. Nntp-Posting-Host: decb.aber.ac.uk
  16.  
  17. >>> On 21 Jan 93 10:06:55 GMT, kers@hplb.hpl.hp.com (Chris Dollin) said:
  18.  
  19. Dollin> In article ... kers@hplb.hpl.hp.com (Chris Dollin) writes:
  20.  
  21. Dollin>   A method is *parametrically polymorphic* in an argument A if
  22. Dollin>   it is independant of the type of A and so can be applied with
  23. Dollin>   values of any type in the A argument.
  24.  
  25. Dollin> In Eiffel, this is genericity; in C++, it can be obtained using
  26. Dollin> template functions (the argument A must then be one of the
  27. Dollin> template argument types).  Dynamically typed (or, using
  28. Dollin> Piercarlo's term, latently typed) languages usually have this as
  29. Dollin> an automatic property.
  30.  
  31. A side note: latent typing is not my own definition; it is popular in
  32. other non OO contexts. 'Latent' is used as the actual type of the values
  33. denoted by a pointer/variable/whatever is latent, i.e.  revealed only at
  34. runtime.
  35.  
  36. I find 'latent' better than 'dynamic'; the latter suggests the erroneous
  37. idea that somehow the type/mode/class of a value can change dynamically
  38. (thus probably Hathaway's bizarre notion that polymorphism is based on
  39. 'formal objects' that can change shape 'dynamically'), while instead the
  40. type/mode/class in just _unknown_ until runtime, not 'dynamic' (a term
  41. that I would reserve for the Self case, where the type/mode/class of an
  42. object can actually change 'dynamically').
  43.  
  44. Dollin> I don't know if it's easy to unify the two kinds of polymorphism
  45. Dollin> in a single framework. Even if so, it might be useful to
  46. Dollin> distinguish them.
  47.  
  48. Well, inclusion and parametric ("true") polymoprhism are just two points
  49. on a spectrum, like this:
  50.  
  51. monomorphism:
  52. #1    can denote values of one type/mode/class
  53.  
  54. polymorphism:
  55. #2    can denote values of any type/mode/class derived from ...
  56. #3    can denote values of any type/mode/class among ...
  57. #4    can denote values of any type/mode/class
  58.  
  59. As far as I know case #3 has no name (where the restriction is not to a
  60. subtree of the derivation hierarchy, but to an arbitrary set of the
  61. types/modes/classes), and I cannot say to have ever found it in any
  62. language, OO or otherwise.
  63. --
  64. Piercarlo Grandi <pcg@aber.ac.uk> c/o Dept of CS
  65. University of Wales, Penglais, Aberystwyth SY23 3BZ, UK
  66.