Python from Wise Guy's Viewpoint
Andreas Rossberg
rossberg at ps.uni-sb.de
Mon Oct 27 13:00:01 EST 2003
Pascal Costanza wrote:
>
> Can you show me an example of a program that does't make sense anymore
> when you strip off the static type information?
Here is a very trivial example, in SML:
20 * 30
Multiplication, as well as literals, are overloaded. Depending on
whether you type this expression as Int8.int (8-bit integers) or
IntInf.int (infinite precision integer) the result is either 600 or an
overflow exception.
So the program does not make sense without type information, because it
does not have an unambiguous (i.e. no) semantics.
I'm ready to admit that it may be a dubious example of a typing feature.
But it is simple, and clearly sufficient to disprove your repeated claim
that static types don't add expressiveness to a language. If you did not
have them for the example above, you needed some other feature to
express the disambiguation.
- Andreas
--
Andreas Rossberg, rossberg at ps.uni-sb.de
"Computer games don't affect kids; I mean if Pac Man affected us
as kids, we would all be running around in darkened rooms, munching
magic pills, and listening to repetitive electronic music."
- Kristian Wilson, Nintendo Inc.
More information about the Python-list
mailing list