Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!rutgers!husc6!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.lang.misc Subject: Re: Check the Arg Count Message-ID: <3214@bu-cs.BU.EDU> Date: Thu, 1-Jan-87 17:19:34 EST Article-I.D.: bu-cs.3214 Posted: Thu Jan 1 17:19:34 1987 Date-Received: Thu, 1-Jan-87 22:37:04 EST Organization: Boston U. Comp. Sci. Lines: 59 From: mangoe@mimsy.UUCP (Charley Wingate) >I also note that in fact Pascal for one HAS variable argument lists-- for >certain system routines such as READ and WRITE. SO does FORTRAN (MAX and >MIN are examples). These are not "system routines" in any useful sense of the word, they are built-ins specifically recognized (and handled) by the compiler. The fact that Pascal admits that such constructs are necessary yet does not allow any equivalent way for a programmer to write such code has always been damning in my mind (that is, you CANNOT provide read() or write() as your own pascal subroutines (not because of the names, call them myread() and mywrite() if you like.) Of course, I am attempting to speak within some context of standard pascal, a retort that there exists something which calls itself a pascal compiler and even seems to accept some pascal code which also allows this is a futile argument. The C equivalent is a language feature available to the programmer, routines like printf() can and are written in C. Thus, the analogy fails. C attempts to solve a much harder problem. >I fail to see the advantage in having separate style and syntax checkers. I fail to see the distinction. Code is code. Do you also demand that all your compilers have all their other functions (pre-processing, lexical analysis, syntax checking, code generation, assembly, link editing) in one module? Of course not, your only complaint is perhaps with the 'cc' command which runs the various passes automatically but does not run lint as you would like. Perhaps that should be an extension or option to CC commands but it's easy enough to implement on your own system with a shell script or by modifying the CC command (this is not equivalent to adding some major language feature or anything, you could "add" it by simply running lint by hand all the time, I am just suggesting that automating that and hiding it under the CC command would be trivial.) >Pascal, of course, takes a very extreme viewpoint on this. Considering its >teaching language heritage, I find it hard to attack the decision that was >made. Students need to learn to write diciplined programs before they go >out and break all the rules, and thus there's advantage to be had in making >those sort of restrictions syntactic requirements. I find this a weak justification. Students should learn to use things like lint etc. You first posit that using variable argument lists is the definition of undisciplined and then proceed to use this axiom. I don't agree with the axiom. If a student can't remember to "line up" his/her arguments to routines then I have little hope for the student (yes, I do teach programming and have for several years, I think this kind of thinking has done more harm than good to students allowing instructors of mediocre quality [or intent] to evade giving the students what they really need, a decent working mental model of computation.) Well, at least you admit its teaching heritage, unfortunately there are more than a few folks out there using pascal for more than just teaching. -Barry Shein, Boston University