Article View: comp.lang.misc
Article #6419Re: Polymorphism
From: Alan Lovejoy
Date: Sun, 23 Apr 1989 07:16
Date: Sun, 23 Apr 1989 07:16
106 lines
5376 bytes
5376 bytes
In article <1810@etive.ed.ac.uk< nick@lfcs.ed.ac.uk (Nick Rothwell) writes:
<In article <5957@pdn.paradyne.com> alan@rnms1.paradyne.com (Alan Lovejoy) writes:
<>-- Definition Of Polymorphism --
<>
<>Full polymorphism means that any component or aspect of a program, program
<>component or programming language must behave as a value. Any and all
<>values must be subject to inspection, modification, storage in memory,
<>usage as a component part of some composite value, usage as a paremeter,
<>usage as an operand in an expression, being computed as the result of
<>evaluating an expression or function, and (re)definition of its form, structure,
<>content or name. The protocol for invoking these common operations must be
<>the same for all values, regardless of type.
<People might disagree about the extent of "full" polymorphism.
Yep, they certainly will. I gave the most extreme definition I could devise
in English. I wanted to start a debate. Looks like it worked.
<ML is
<certainly polymorphic, although you can't "inspect" all values (they may
<be abstract, or function objects).
By "inspect" I simply mean "read." If I can code "IF a = b," then I can
"inspect" or "read" "a" and "b".
<"modification" is only allowed on
<objects created specially for the purpose: how do you modify a function?
By "modification" I simply mean "change." If I can code "INC(i)", so that
the value of "i" is incremented to the next "higher" member of the ordered set
of values of which "i" is a member, then I have the ability to "modify" "i".
Also, I really want to require that modification be possible in principle,
if the programmer wants to define any operations that modify values of some
type.
As for "modifying a function," how about recompiling it? Or changing the
input parameter "type" and/or "range" checking?
<"Storage in memory" - doesn't make sense for higher-order garbage collected
<languages.
Would you accept Smalltalk as a higher-order garbage-collected language?
The Smalltalk code:
"Smalltalk at: #Caveman put: 'Fred'.",
when evaluated, causes the instantiation of an object of class String which
contains the characters 'Fred'. These characters would be stored in memory
in any Smalltalk implementation for any machine of which I am aware.
What did you think I meant?
<"(re)definition of its form" I don't understand...
Smalltalk permits the instance variables (fields) defined for the instances
of a class to be removed and/or added to even when instances of a class
are already in existence. When this happens, the existing instances are
dynically modified to reflect this "redefinition" of form.
To allow the definition of the form of a value is simply to allow its
structure to be defined.
<>To say the same thing more concretely: numbers, characters, data types,
<>procedures, variables, addresses, blocks, execution contexts, name bindings,
<>scopes, processes and the number of bits in an integer must all be "first
<>class objects."
<
<...although a lot of these things (addresses? blocks?) don't exist in some
<languages. And I don't see that you want to allow the user to alter absolutely
<everything ("hey, let's change the number of bits in a word from being 32
<to being yellow...").
I didn't say that absolute, full polymorphism was necessarily a good idea.
I merely gave a definition of the extreme case for pedagogic purposes and
so as to incite discussion.
< I presume that this is David Harland's definition of polymorphism...? His
He might quibble with it. It's really mine, strongly influenced by his ideas.
<approach is to provide this rich model, where everything goes, with
<sophisticated hardware support. But, this is a specific approach, and shouldn't
<be taken to imply that polymorphism encapsulates everything in this approach.
I don't think that dealing with the MINIMUM specifications of concepts is
always the most productive approach. Defining the ideal is sometines
more instructive. Transitive closure.
<>-- Definition of Abstraction --
<>
<>Abstraction is the process of discovering and/or expressing what is INVARIANT,
<>constant and organic in a system by taking out, leaving out or not mentioning
<>that which is changing, temporary or accidental.
<Isn't that a rather strange way of putting it? I view abstraction as a process
<of distinguishing a system's interface from its implementation.
That's because the interface is invariant under multiple possible
implementations.
Alan Lovejoy; alan@pdn; 813-530-2211; AT&T Paradyne: 8550 Ulmerton, Largo, FL.
Disclaimer: I do not speak for AT&T Paradyne. They do not speak for me.
_________________________Design Flaws Travel In Herds_________________________
Motto: If nanomachines will be able to reconstruct you, YOU AREN'T DEAD YET.
Technical Details
Message-ID:
<5973@pdn.paradyne.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!pdn!rnms1!alanReferences:
<5957@pdn.paradyne.com< <1810@etive.ed.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!pdn!rnms1!alan From: alan@rnms1.paradyne.com (Alan Lovejoy) Newsgroups: comp.lang.misc Subject: Re: Polymorphism Message-ID: <5973@pdn.paradyne.com> Date: 23 Apr 89 07:16:23 GMT References: <5957@pdn.paradyne.com< <1810@etive.ed.ac.uk> Sender: news@pdn.paradyne.com Reply-To: alan@rnms1.paradyne.com (Alan Lovejoy) Organization: AT&T Paradyne, Largo, Florida Lines: 106