[Types-sig] Issue: definition of "type"

skaller skaller@maxtal.com.au
Thu, 23 Dec 1999 07:04:43 +1100


Greg Stein wrote:

> > a = [Foo(), Bar()]
> >
> > for el in a:
> >    el.doSomething()
> >
> > Doesn't this rely on run-time information? How would a type system deal
> > with this? I suppose I'm entering the domain of interfaces now...
> 
> The type of "a" is a List where the elements' type is the union of the
> type of each initialization value.

No. Extra values can be appended of other types. If you want to have
lists of a particular type, this must be declared as a constraint.

-- 
John Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
voice: 61-2-9660-0850