[Types-sig] Sample declarations
Paul Prescod
paulp@ActiveState.com
Tue, 13 Mar 2001 11:15:01 -0800
Daniel Wang wrote:
>
>...
>
> Anyway, now that I think about how this whole discussion got started.
> i.e. lets avoid the complexity of a "real type system" and just use dynmaic
> checks. I think it's doomed. :) The complexity of a type system is not in
> how you enforce it, but deciding on how to document what you want enforced.
> A langauge of dynamically checked assertions has the same problem. The
> assertion language is just as complicated as a type system.
The assertion language is incredibly complex compared to IDL. It is
Python. But the beauty of using Python as an assertion language is that
Python programmers already know Python!
> Someone suggested that one could infer a type by examining the "check"
> method of an object. This actually is not as crazy as it sounds. If people
> are willing to program in a small subset of Python for implementing checks,
> these "behavioral" type checking isn't so crazy an idea. The subset would
> have to be a terminating side-effect free subset of python.
I like the idea. I'll leave it to a PhD student to define that subset.
--
Python:
Programming the way
Guido
indented it.
- (originated with Skip Montanaro?)