I think what you have stumbled across here, Jack, is the probability
that the sort of feature we've been talking about may only be able
to be implemented ( of if implemented, used ) in a limited fashion
in a dynamic/loosely typed O-O language. It might actually work in
a compiled, strongly-typed, type-inference class based type language,
where allowed( foo()+1 ) would most often turn into a compile time
consistency check, and only turn into a runtime test when there was
not enough context to determine what set of objects 'foo' could
possibly be bound to.
>
> Oh well, another interesting idea down the drain,
This is the 2nd time I've tried to recall a Cardelli paper
about the addition of type 'Dynamic' to Modula-3 : the
question came up in another forum about how much checking
was done at compile time and how much at run time.
( Dynamic was an attempt to add a dynamic run time typing
to a language that was strongly compile time typed in a
SAFE manner - i.e. without breaking all of the type
checking with the contagion of uncertainty. ) I know
Guido has stated that Modula-3 was one of the inspirations
for python - perhaps he will have some comment when he
get back.
- Steve M.