Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!ukma!asuvax!noao!arizona!gudeman From: gudeman@cs.arizona.edu (David Gudeman) Newsgroups: comp.lang.misc Subject: Re: Dynamic typing (part 31,497) Message-ID: <2046@optima.cs.arizona.edu> Date: 17 Apr 91 17:41:11 GMT Sender: news@cs.arizona.edu Lines: 31 In article <29350@dime.cs.umass.edu> victor yodaiken writes: ] ]Your example seems to involve the use of type definitions. If I now write ]f((1,2,3,4)) the compiler should be able to inform me that I have ]attempted to apply "f" to a list, but "f" is only defined on sets and ]integers. For any variable v in any context whether mathematical, programming, or natural language, you can find some set V such that all the possible values of v are in V. However, static typing implies more than that: it implies that expressions are constrained statically such a way that all expressions can be assigned types from a restricted set. The restricted set is such that machine representations can be decided on at compile time and such that no type information has to be associated with a value at runtime. My example cannot be implemented in any programming language without someone -- either the programmer or the language implementer -- associating type information with the values of the sequence. If you associate type information with a value at runtime then you have dynamic typing. My claim is not now, and never has been, that all static type checking is bad, evil, or even rude. I am only saying that in situations such as the above, it is the language implementator who should be taking care of type tags rather than the programmer. When the implementator does it, it leads to less code, less complexity, and fewer bugs. -- David Gudeman gudeman@cs.arizona.edu noao!arizona!gudeman