Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!dciem!nrcaer!cognos!johna
From: johna@cognos.uucp (John C. Anderson)
Newsgroups: comp.lang.smalltalk
Subject: Re: declarations vs smalltalk
Message-ID: <1062@snowbird.UUCP>
Date: Mon, 6-Jul-87 13:10:42 EDT
Article-I.D.: snowbird.1062
Posted: Mon Jul  6 13:10:42 1987
Date-Received: Wed, 8-Jul-87 06:10:58 EDT
References: <245100009@orstcs>
Reply-To: johna@cognos.UUCP (John C. Anderson)
Organization: Cognos Inc., Ottawa, Canada
Lines: 53

In article <245100009@orstcs> budd@orstcs.cs.ORST.EDU writes:
>      [... deleted ...]
>In short, there seems to be an implicit conflict between strong typing, or
>typing of any sort, and polymorphism.  Strengthing one limits the other.
>Smalltalk has come down strongly on
>the side of polymorphism, and even I (Smalltalk heretic than I am) have a
>hard time imagining anything similar to Smalltalk that changes this.
>
>I am looking forward to hearing how I am all wrong, and how option number 5
>makes all problems go away.
>

Well, I dont think there is an option 5 which will "make all problems
go away",  however,  there is an option 4.78 which goes a long way in 
the right direction.  A detailed reply would be too lengthy for inclusion
here, but I'll give a brief indication of the flavour of the
solution,  and some pointers to the literature which you can chase
down if you're interested.

To start with,  I have to (mildly) disagree with your statement that
polymophism and strong typing are in conflict.  It is true that strong
typing as exhibited by, eg Pascal, is in conflict with polymorphism.
However,  the real problem here is not strong typing,  but that the
type theory used in Pascal is extremely primitive.  For example,  to 
describe the (polymorphic) concept "pair of t" where t is any type is
quite impossible in Pascal.  You can describe "pair of int", or "pair of real",
etc (as a record or two element array),  but you can never describe the
general concept.  However,  there are languages in existence today which
have a much more powerful notion of type.  These languages are quite capable
of mixing strong typing with polymorphsim and generally can handle concepts
like "pair of t" quite easily and efficiently. 

One such language which is quite well known is ML.  
See "A Proposal for Standard ML" by R. Milner, in the Proceedings of the
Symposium on LISP and Functional Programming Aug/84.  

There is an excellent article in Computing Surveys, December 1985, 
"On Understanding Types,  Data Abstraction,  and Polymorphism", by Cardelli 
and Wegner.  This article covers the key issues,  and is quite readable.  
If nothing else,  I suggest this article.  C & W demonstrate the combination
of polymorphism and strong typing,  and in addition show how the inheritance
mechanism of Smalltalk provides for certain restricted forms of polymorphism.

> [ ... repeated from above ]     
>I have a hard time imagining anything similar to Smalltalk that changes this.

Please have a look at "An Exemplar Based Smalltalk", Lalonde, Thomas, and 
Pugh, in the Proceedings of OOPSLA'86 (Object-Oriented Programming Systems,
Languages and Applications).  
-- 
John Anderson, Cognos Incorporated, 3755 Riverside Drive,
Ottawa, Ontario, CANADA  K1G 3N3
(613) 738-1440	   decvax!utzoo!dciem!nrcaer!cognos!johna