Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.c++,comp.lang.misc
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!swrinde!sdd.hp.com!hplabs!hplextra!hplb!cdollin!kers
From: kers@hplb.hpl.hp.com (Chris Dollin)
Subject: Re: Types, types: static vs. dynamic -- classification
Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
Message-ID: <KERS.95Nov19164511@cdollin.hpl.hp.com>
In-Reply-To: rtor@ansa.co.uk's message of 17 Nov 1995 21:33:27 GMT
Date: Sun, 19 Nov 1995 23:45:11 GMT
References: <vwjviowz091.fsf@osfb.aber.ac.uk> <vwju44dzlwt.fsf@osfb.aber.ac.uk>
	<KERS.95Nov17135258@cdollin.hpl.hp.com> <48iv37$l4c@plato.ansa.co.uk>
Nntp-Posting-Host: cdollin.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Followup-To: comp.object,comp.lang.smalltalk,comp.lang.c++,comp.lang.misc
Lines: 41
Xref: glinda.oz.cs.cmu.edu comp.object:40942 comp.lang.smalltalk:30808 comp.lang.c++:160859 comp.lang.misc:23904

In article <48iv37$l4c@plato.ansa.co.uk> rtor@ansa.co.uk (Owen Rees) writes:

   Chris Dollin (kers@hplb.hpl.hp.com) wrote:
   : Smalltalk seems to fit quite happily into this framework, given that sending
   : ``doesNotUnderstand'' is the way it notifies type errors. So in what sense
   : are you saying that ``Smalltalk-80 does NOT have types''? And, if you 
   : present a notion of type that Smalltalk does not satisfy, what advantages
   : does this notion have that we should take it as *the* notion of type,
   : rather than just one among many?
   : --

   I think there is an important difference between class and type in the
   context of Smalltalk.

   Isn't there an 'addSelector' method of 'Class'? This means you can
   dynamically change which selectors/methods are understood by instances
   of the class. The objects remain instances of the same class, but
   exhibit different behaviour - they are now of a different type. This
   being the case, types are useful for reasoning about Smalltalk
   programs, but of potentially misleading within the language.

   If you claim that types and classes are the same, what would you call
   whatever it is that has changed when you use 'addSelector'?

I didn't (and don't) claim that ``type'' and ``class'' mean the same thing in
Smalltalk; my description of type (which you deleted) said that what was
important was the relationships between the operations and the (types of)
the values. This notion is not the same as that of the Smalltalk class,
because objects of vastly different classes can still satisfy the same
type description, and further (an instance of) a subclass need not satisfy
the same interface as (an instant of) the supertype.

And it is true that in Smalltalk the behaviour of objects can change over time,
and that this means (using my meaning for ``type'') that an object can 
change its type over time. But this strikes me more as a property of an
interactive development system rather than anything fundamental about the
language.
--

Regards,    | ``"I can't suit myself," said Weinbaum, a little petulantly.
Kers.       | "I work for the Government".'' - Blish, "The Quincunx of Time".
