Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!ni.umd.edu!uc780.umd.edu!cs450a03 From: cs450a03@uc780.umd.edu Newsgroups: comp.lang.misc Subject: RE: Dynamic typing (part 3) Message-ID: <26MAR91.18541581@uc780.umd.edu> Date: 26 Mar 91 18:54:15 GMT References: <815@optima.cs.arizona.edu> <20MAR91.08580313@uc780.umd.edu> <21MAR91.23594992@uc780.umd.edu> <22MAR91.20485982@uc780.umd.edu> <039AIL3@xds13.ferranti.com> Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 89 Nntp-Posting-Host: uc780.umd.edu Peter da Silva writes: [little peter/paul dialog about making assignments unique, ending: >OK, I still don't follow what the point is. Why avoid assignments, >and how do you do things like state machines or stepping through a >list?] Umm.. I like the Peter/Paul style, but my name starts with an 'R' (other than that, pronounced like Paul). (1) The point is not to avoid assignments. The point is to be able to see the program all at once. (Mentally, if not physically). (2) I generally don't need to make state machines. When I do, I try to represent the machine as a single data object (the machine state) which is mapped by a simple function from one state to another. Another thing is that usually, I'll want a history of the machine, so each state is stored in a separate location. In functional programming, there is a significant difference between initialization and re-assignment. (3) I generally don't need to step through lists. Generally, this is done for me automatically by primitives. Most of the time, I consider the stepping process trivia (especially when the primitive simulates parallel execution, as 1 1 0 0 and 1 0 1 0 yields: 1 0 0 0). Pure functions are much easier to validate than dirty code, for the same kind of reasons that static code is easier to validate than self-modifying code. Again, the point is not to prohibit re-defining of some value, the point is to use simpler techniques where possible. And, again, the advantages are in development and debugging times. When you're used to it, C statements like for (j=0; jPaul> [refering to descriptive comments as type declarations] >Peter>But wouldn't it be nice if the language understood those declarations? >Paul> Then they'd be code. >That's the point. Would you settle for a language which provided no special syntax for comments (i.e. where comments are just pieces of data that you throw into the program)? Raul Rockwell