Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!mit-eddie!uw-beaver!ubc-cs!manis From: manis@cs.ubc.ca (Vincent Manis) Newsgroups: comp.lang.scheme Subject: Re: Order of evaluation (was Re: evaluating () should be an error Message-ID: <1991Apr5.081428.24587@cs.ubc.ca> Date: 5 Apr 91 08:14:28 GMT References: <1991Mar26.224805.23381@cs.ubc.ca> <6260003@otter.hpl.hp.com> Sender: usenet@cs.ubc.ca (Usenet News) Organization: Institute for Pure and Applied Eschatology Lines: 47 In article jinx@zurich.ai.mit.edu writes: >I'm just curious, but would all of you who advocate for fixing the >order of argument evaluation accept the following order: > >All the even numbered arguments are evaluated first from right to >left, and then the odd numbered arguments are evaluated from left to right. I was going to post a suggestion that arguments be evaluated from right to left consistently, but, on the whole, I prefer Jinx's suggestion. The only improvement I would make is to replace 'even' with 'prime', and 'odd' with 'composite' (plus perhaps a footnote that all Mersenne numbers are to be considered prime for the purposes of Scheme specification). Rather more seriously, I would really like to see an example where insisting on the order of evaluation IN AN APPLICATION results in demonstrably improved readability. (Scheme isn't a purely functional language, and we all love sequential evaluation in our special forms...) What I have generally seen in the past is shorter code, not more readable code. What I would like to see is a specific example, in two versions, one with and one without sequential evaluation. Since the trend in programming languages since at least the late 1960's[*] has been not to specify order of evaluation, I think the onus is on those who would change this practice to demonstrate compelling reasons for doing so. --- * ALGOL-68 was the first language of which I was aware which adopted this rule. I remember a paper by Charles Lindsey in 1969 explaining why this was a good thing. --- I recently posted a peculiar example of the form (+ (begin (display "hello") 1) (begin (display "world!") 2)) and I do remember David Parnas once saying that the control system he developed for the Tomcat [? Some US Navy plane, anyway] interleaved code this way (they didn't want a multitasking kernel, because they were worried about interrupt response), though that system was written in assembly language. I do hope that advocates of sequential evaluation have a better example than this. -- \ 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