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