Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!gatech!mcnc!uvaarpa!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: <22MAR91.20485982@uc780.umd.edu> Date: 22 Mar 91 20:48:59 GMT References: <815@optima.cs.arizona.edu> <20MAR91.08580313@uc780.umd.edu> <21MAR91.23594992@uc780.umd.edu> Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 49 Nntp-Posting-Host: uc780.umd.edu Peter da Silva > Me >> >> Generally, each assignment to a variable is unique. (I try not to >> re-assign, and when I do, I try and make sure re-executing that >> section of code would not cause a problem). Exception made for loop >> counters, but not for other assignments made within the loop. >This is an unusual coding style, in my experience. Are you actually >limitin assignments, or are you hiding those assignments in call by >reference? Perhaps a code fragment would help. It's not really that unusual... especially when you consider that I try but don't always succeed ;-) A typical C ferinstance would be any code where you initialize a table. Other C examples include things like |= or &= (after initializing with some neutral value). Code example, hmm.. anything I can think of is boring or long or too complicated to remember off the top of my head. meta-sample code (this code would really run, given appropriate functions, and the assignments are pure (each function mallocs a new array or whatever, which gets freed when its ref count goes to zero)). text =. F_READ: file text =. (HANDLE_BACKSLASH: '.\r..\0.') TEXTREPL: text text F_REPLACE: file Ok, normally I do a lot more than just kill garbage characters (carriage returns and ascii nulls in this example) the point here is that you could execute any of these lines as many times as you like. (Just try and execute them in order, please.) Is that what you mean by an example? (And I hope you don't mind if I don't provide "real code" -- I have the pleasure and misfortune getting paid to write in APL. Pleasure because it's so easy, misfortune because it's so hard to get code fragments through your typical text editor, or news feed.) Incidentally, the trailing : means that the name is a true constant (can't be erased or re-assigned, though localization has normal affects). Not a feature I get to use at work (well, not in any consistent fashion), but one I'd like. (The language is J, which I'd prefer to use over APL once a sufficiently fast version exists.) [refering to descriptive comments as type declarations] >But wouldn't it be nice if the language understood those declarations? Then they'd be code. Raul Rockwell