From: Bob Hathaway <objsys@netcom.com>
Subject: Re: SUMMARY: Object-Oriented Software Maintenance (1200 lines)
Date: Thu, 16 Apr 92 03:33:38 GMT
Organization: Object Systems

In article <1992Apr15.151630.17395@heeg.de> hasko@heeg.de (Hasko Heinecke) writes:
>In article <xjwjzfq.objsys@netcom.com> objsys@netcom.com (Bob Hathaway) writes:
>>  Also, Smalltalk object declarations do not specify type or class, one
>>  must look at the initialization of an object to determine its type and
>>  parameters give no clue except for comments and the semantic content of
>>  their name.  Hence a quick look shows all objects to be the same as the
>>  epitomal void* type in C++ and objects can even change their class with
>>  the "become" Object method.  So this leaves Smalltalk as dynamically
>>  typed, but in the most unrestricted way because there are no type
>>  declarations at all!  This should not be confused with "typeless" as
>
>You should look at the objects class, do this by asking the object. Objects are
>NOT data. Object just know what class they belong to. Nothing about
>initalization/declaration. 

Yes, I believe the lack of static type declarations together with dynamic
typing is often referred to (questionably?) as typeless.

>I think, you confuse the terms "parameter" and "object". 

No, I meant there are two separate cases.  Most languages allow type
restrictions to be placed on parameters, which Smalltalk doesn't, and most
languages also allow either type restrictions or type instantiations in
declarations, which Smalltalk also doesn't.  For example, CLOS allows
parameters to be declared without types (the typeless, or void * case
statically), but allows an optional static type expression, called a
specializer, if desired.  And for clues, you could look at the use of a
parameter or undeterminable object, one could assume that most of the
messages in a "typeless" language were intended to succeed:-)

Also, I recall reading in Byte magazine some time ago that the original
Smalltalk designers would have liked to add some static typing to Smalltalk,
but that they just hadn't gotten around to it.

>Parameters are simply a concept for communication between objects. Thid
>communication is not restricted to certain classes (communication is "untyped")
>whereas objects have a class, which is well defined at all times.

Yes, dynamic types are always well defined (assuming type-safety) but the
term typeless refers to the fact that statically (i.e. looking at the
program text) they are not, that was my point.  Maybe we should say that
Smalltalk is statically typeless.

>I think, the whole discussion about typing exists because people tend to say
>"Hey objects are data and methods are procedures" which is entirely wrong.
>Objects are entities that communicate vie messages whose contents is not
>restricted to certain things that you don't really have in Smalltalk. It's
>just that you can throw anythig at anybody, but his reaction will differ
>depending on if it was a dollar bill or a rock. Maybe, you'll get some kind
>of error notifier, but still you can do it - you are not restricted. The
>parameter "thrownObject" is not typed.

This is just true in the unrestricted dynamic case, in the restricted case
with types "thrownObject" is restricted to either its declared class or one
of its subclasses and its just the declared class in the sliced call-by-value
case in C++ (it also applies dynamically), there is no polymorphism.  And
in the static message case, the compiler can statically determine if a
matching method or function can be found and can declare an error if one
isn't; this is restricted, polymorphic, and still quite OO.

>IMHO, typeless, strongly, weakly, dynamically or statically typed are not
>applicable at least to Smalltalk - or even to any OOL.

Smalltalk is dynamically typed, C++ (and similar languages) are statically
typed, etc.  I think you must have an awfully picky definition of an OOL!-)

bob
objsys@netcom.com

P.S.  Although its not with me, check Booch "Object-Oriented Design" for
      some good coverage of statically and dynamically typed languages.