🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #174

Re: What is a type? (was Re: Fortran90 and Arrays)

#174
From: Stephen J Bevan
Date: Fri, 10 Apr 1992 17:09
65 lines
3360 bytes
In article <1992Apr10.095151.28116@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
   Ok.  But what is your criterion for determining which properties of 
   an object are `type' and which properties are just `value'.

The `type' properties of an object are whatever I assign to the object
or whatever the system infers for itself.  [I don't think this answers
your question, but I don't quite understand the question in the first
place :-)]


   I specified an explicit criterion for deciding what constitutes
   type: those properties which are permanently associated with a name
   (or function, expression, etc.) regardless of run-time variations.

And I objected, because I think this is one particular type of `type'
namely the `static type' of the object.  Whilst it is true that in a
certain class of languages there is no difference between the `static'
and `dynamic' type of an object, I don't think you can generalise to
saying that this means `type' = `static type' and the `dynamic type'
somehow isn't a `type'.


   At both ends of the language spectrum, the definition I gave for type
   is meaningless.

That's another reason why I don't like it as a definitin of `type'.


   In pure functional languages, _no_ property of an object is dynamic
   in a given scope.  So, by my definition, all attributes (including
   those normally called `value') are type attributes.

I'm beginning to _hate_ the definition now.


   In a typeless language (say, SmallTalk for variation in the
   discussion)

Smalltalk is not "typeless" as far as I'm concerned, it has strong,
dynamic (or latent) types.


   all the attributes associated with a name can be assigned.  So, by
   my definition, none of these attributes are type attributes.  In
   between these extremes are the only languages in which the word
   `type' is meaningfully distinguished from `value'.  In my opinion.

So why use a definition of `type' that has such a narrow scope.  IMHO
`static type' is comonly used to describe what you want, so why not
use that?


   (The above is not quite true of SmallTalk.  The distinction between
   a global variable and a temporary or local one is determined by the
   syntax of the identifier - with globals starting with an initial 
   capital letter and others beginning with a lower case letter.  So
   this property qualifies as a type attribute by my definition.)

I thought the upper/lower case stuff was a _convention_ for users
rather than anything enforced by the system.  I'm sure I've fired up
Smalltalk in the past and had global variables called "foo".  It has
been a while, so I guess I could be wrong.  Any current Smalltalkers
want to put the record straight?

bevan
Technical Details
Message-ID: <BEVAN.92Apr10180934@panda.cs.man.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!m1!bevan
References: <ROCKWELL.92Mar21001252@socrates.umd.edu> <BEVAN.92Apr9151907@panda.cs.man.ac.uk> <1992Apr10.095151.28116@newshost.lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!m1!bevan
From: bevan@cs.man.ac.uk (Stephen J Bevan)
Newsgroups: comp.lang.misc
Subject: Re: What is a type? (was Re: Fortran90 and Arrays)
Message-ID: <BEVAN.92Apr10180934@panda.cs.man.ac.uk>
Date: 10 Apr 92 17:09:34 GMT
References: <ROCKWELL.92Mar21001252@socrates.umd.edu>
 <BEVAN.92Apr9151907@panda.cs.man.ac.uk>
 <1992Apr10.095151.28116@newshost.lanl.gov>
Sender: news@cs.man.ac.uk
Organization: Department of Computer Science, University of Manchester
Lines: 65
In-reply-to: jlg@cochiti.lanl.gov's message of 10 Apr 92 09:51:51 GMT