Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uwm.edu!ogicse!milton!uw-beaver!ubc-cs!manis From: manis@cs.ubc.ca (Vincent Manis) Newsgroups: comp.lang.scheme Subject: Re: Re: Order of evaluation (was Re: evaluating () should be an error Message-ID: <1991Mar28.030252.4033@cs.ubc.ca> Date: 28 Mar 91 03:02:52 GMT References: <1991Mar26.224805.23381@cs. Sender: usenet@cs.ubc.ca (Usenet News) Organization: Institute for Pure and Applied Eschatology Lines: 32 I guess the reason I feel so strongly on this matter is that I once was a humble peon involved in writing an ALGOL-68 compiler. ALGOL-68 was dedicated to the proposition that no matter how strange a construct was, if some meaning could be found for it, it should be allowed. The compiler my group worked on (never completed) had an entire lexical pass devoted to matching parentheses. Each time we thought we had it working, one of our team members would ask what happened if we had a certain parenthesis, then 50 pages of code, and then another symbol. Sure enough, we had another special case. Languages should be designed in such a way that dubious practices are allowed if they don't interfere with compilation or fast execution, but prohibited if they do. I have to hunt very hard for a case where I'd want to write code which is dependent upon order of evaluation (+ (begin (display "Hello, ") 2) (begin (display "world!") 3)) is an interesting, if stupid, example of interleaving 2 separate code streams. On the other hand, clearly not prescribing the order of execution can make things easier for the compiler. There is little to be gained for the programmer, and something to be lost in efficiency, by prescribing order. I might note that any dialect of Scheme which provides syntax extension allows the programmer to write sequenced procedure call forms, e.g., (+-sequentially (begin (display "Hello, ") 2) (begin (display "world!") 3)). I would encourage some of the pro-prescribers to tell us how frequently they do this sort of thing. -- \ Vincent Manis "There is no law that vulgarity and \ Department of Computer Science literary excellence cannot coexist." /\ University of British Columbia -- A. Trevor Hodge / \ Vancouver, BC, Canada V6T 1W5 (604) 228-2394