Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!rex!ukma!rutgers!gatech!udel!haven.umd.edu!socrates.umd.edu!socrates!rockwell From: rockwell@socrates.umd.edu (Raul Rockwell) Newsgroups: comp.lang.misc Subject: Re: definitions Message-ID: Date: 29 Apr 91 14:13:55 GMT References: <2494@optima.cs.arizona.edu> <51984@nigel.ee.udel.edu> <333124@socrates.umd.edu> <11525@mentor.cc.purdue.edu> Sender: rockwell@socrates.umd.edu (Raul Rockwell) Organization: Traveller Lines: 35 In-Reply-To: hrubin@pop.stat.purdue.edu's message of 29 Apr 91 10: 53:41 GMT Herman Rubin: > I was of the opinion that strong typing meant that objects (bit patterns in > memory, registers, discs, etc.) of one type could not be used as objects of > another type. As someone who has deliberately used this of course highly > non-portable feature often, it is this aspect to which I object. It is entirely possible to define a function of the form pun(to_type, from_type, source_object) All versions of this are portable, but defining such a function so that it is efficient on one machine does not always mean that it is efficient on another machine. In the general case (arbitrary types, arbitrary platform) you will need to copy the object when you change its type. Tomas Breuel: > Dynamically typed programs are also impossible to prove type-correct, > and many trivial errors go unchecked. This is true when you are using a statically typed language (which does not provide support of dynamically typed programs). This is not true in general, however. On the hunch you've killed the subject thread where we've been discussing this, I will repeat: You can implement static typing in a dynamically typed language by introducing "functions" which do no processing but which have limited domains. These functions are equivalent to type declarations. In a well-written program, in a well-designed language, you should not _usually_ need such a function. All primitive functions of the language should have such functionality built-in. Raul Rockwell