|> I have been looking at some recent papers on 'types' in OO context, and
|> have been having some discussion on such, and these have led to realize
|> that some people (perhaps many...) have not clear the distinction not
|> only between 'type' and 'type constraint', but the related one between
|> 'type system' and 'type constraint system'.
|> I'll try, for the record, without much hope, to illustrate it...
You made the difference perfectly clear, at least to me.
Based on your definition I conclude that Smalltalk has a type system
but not a type constraint system.
|> * in ISO Pascal 'var x : record ... end' constrains 'x' to denote
|> values of the ``anonymous'' type defined therein, and _only that
|> type_. More explicitly: 'var x; require typeof value(x) == record
|> ... end;'.
|> * in Pascal 'var x: cmplx' constrains 'x' to denote values of the type
|> 'cmplx' or *any type with the same structure*. More explicitly: 'var
AFAIK Pascal (like C/C++, Eiffel, Ada) has nameequivalence
for (named) types, so the same structure woun't do;
Modula-2 is one that has structural equvialence.
|> x; require typeof value(x) equiv cmplx'.
What's the difference between "==" and "equiv" ?
|> Since as a
|> rule type metaoperators define not only the storage structure of a new
|> type but also its constructors and accessor functions, a large part of
|> designing a type system is deciding how far one wants to have the
|> compiler go in synthetizing those;
Well, like distinguishing type-system from type-constraint-system
you could additionally distinguish the implementation of a type
(some call it class) from its interface (type without implem. is
an abstract type).
The type-interface-system usually is the reference for the
type-constraint-system and the type-implementation-system.
* A type-implemenation(-constraint ?) says:
"class y implements interface-x"
"ctor y constrained-to-producing values-conforming-interface-x"
* A type-constraint says:
"var y constrained-to-containing values-conforming-interface-x"
,_. Ulf Schnemann
#, \ Fakult?t fr Informatik, Technische Universit?t Mnchen, Germany.
v=-< WWW: http://hphalle2.informatik.tu-muenchen.de/~schuenem/