Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.c++,comp.lang.misc
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!uwm.edu!chi-news.cic.net!newsfeed.internetmci.com!in1.uu.net!nntp.cadence.com!news
From: Simon Kinahan <simonk>
Subject: Re: Types, types: static vs. dynamic -- classification
Content-Type: text/plain; charset=us-ascii
Message-ID: <DHD9B5.13J@Cadence.COM>
Sender: news@Cadence.COM
Content-Transfer-Encoding: 7bit
Organization: Cadence NVision
References: <46b6vu$g72@watnews2.watson.ibm.com> <46h9g7$45s@news4.digex.net>	<46ihua$23p@outlaw.zfe.siemens.de> <vwj68hgx9lv.fsf@osfb.aber.ac.uk>	<46jrjp$h0k@watnews2.watson.ibm.com> <vwjd9ble2fm.fsf@osfb.aber.ac.uk>
Mime-Version: 1.0
Date: Wed, 1 Nov 1995 13:25:52 GMT
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3 sun4c)
X-Url: news:vwjd9ble2fm.fsf@osfb.aber.ac.uk
Lines: 41
Xref: glinda.oz.cs.cmu.edu comp.object:40119 comp.lang.smalltalk:30112 comp.lang.c++:157550 comp.lang.misc:23609

pcg@aber.ac.uk (Piercarlo Grandi) wrote:

>In most languages used in the past twenty years values are *implemented*
>as untyped bitstrings, but that's just the *compiler's* business: the
>*language* defines values as typed entities (save for modest exceptions
>like the ability to do bitwise operations on integral types in C).

Beep. Sorry, this is wrong. C defines the integer and character types as
being bit strings, and programmers assume even more than is actually defined,
and this is normally considered a reasonable practice. It applies much
less to C++, but to do lots of things in C you *need* to know how the
basic types are implemented, as 32, 16 and 8 bit bit strings. 

>Perhaps you should really revise your Smalltalk, for in no way in
>Smalltalk "data describes itself" and "types were unneccessary baggage
>from the past". For in Smalltalk data are described by classes (which
>implement/are types) not by themselves, and Smalltalk is a strongly (if
>latently) typed language. Again you seem to have forgotten the small
>detail of the 'class' method of the Object class, which returns the,
>ahem, "type" of a data object.

Smalltalk objects certainly do carry a 'tag' stating their class, all
objects have this and it is always right. However to call this a type
and to say Smalltalk is 'strongly typed' is to use a very unusual
definition of type.

To say that a language is typed, as I see it, it must perform some
checks on types, either at run time or at compile time.  To call a 
language strongly typed it must perform these checks at compile
time in order to remove the possibility of some kind of error
arising at run-time (modern C and C++ ensure that values are not
unwittingly treated as being the wrong type, Standard ML ensures that
no operation is ever performed on a value of the wrong type. etc). 

Smalltalk does none of this, unless you count 'message not understood'
as a limited form of dynamic type checking.

Simon
-- 
     1

