[Types-sig] Core Python.... (less is more)
20 Jul 2000 14:40:55 -0400
Martijn Faassen <email@example.com> writes:
> There were some issues with this raised by Guido among others in the
> previous wave of big discussion on this list. Some of the runtime checks
> might become very expensive (for instance if a list is passed into the
> Swallow part, and Swallow wants a list of strings, all the elements would
> need to be checked).
I there are schemes to avoid this particular problem. In this case
you move the checks into the places when you deconstruct the list. i.e. you
check that each element is a string when you access an element and just
check that the thing you pass into the Swallow part is actually a list. This
delays the error reporting which can be a good or bad thing....
Alternatively, one can add a flag to distinguish between homogeneous
vs. heterogenous lists, or just make sure lists keep track of the set of
types of all their elements. In anycase, there is some required cleverness
for sure but I don't think this particular problem is a big one. This
casting problem is very simlar to some boxing/unboxing issues found in the
guts of several type based compilers I know about, and I think almost all
the tricks used in that framework can be adapted.
So where's the most recent info on Swallow... ?