Newsgroups: comp.lang.scheme Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!uw-beaver!rice!leto.rice.edu!matthias From: matthias@leto.rice.edu (Matthias Felleisen) Subject: Re: Fixing the order of evaluation. Minimizing the unexpected. Message-ID: <1991Apr5.021422.12385@rice.edu> Summary: do it! Sender: news@rice.edu (News) Organization: Rice University, Houston References: <9104041629.AA19876@schizo> Date: Fri, 5 Apr 91 02:14:22 GMT In article <9104041629.AA19876@schizo> gjc@mitech.com writes: >Odd numbered arguments right to left and even ones left to right? >Of course that was proposed as just about the most stupid thing that >anybody could think of. (What if somebody said, *yes*?) No, let's say yes. I'd rather have some order than none! >Face it. People understand the written word, and written directions >are given to people in this format: LEFT-TO-RIGHT, TOP-TO-BOTTOM. I am so happy to see that somebody finally said this: that's the way it should be, and yes, PERIOD. Left-to-right is how we READ. And then we PARSE. And then we UNDERSTAND. If we can't even read, how are we going to understand? People want a simple mental model of program execution because that's the basis for programming. Unordered evaluation of application expressions is a major obstacle to a simple model. Ask students who learn to program in PURE SCHEME (the functional subset). They assume left-to-right and hand/head-simulate execution that way. When they get an error message or the program gets into an infinite loop, they look for sources of errors and loops in that fashion. Worst of all, we always claim that (PURE) Scheme is a deterministic language. But given that a compiler can choose an arbitrary order of evaluation for every application expression during every compilation, the "same" Pure Scheme program may never reproduce the same error or infinite-loop behavior. Don't bother to argue that errors or infinite loops are not proper behavior because if you ever programmed, you know it's not true. Whatever the benefits of an unspecified order of evaluation for compiler writers are, the costs are too high a price to pay. We all program with some mental model of program execution, and unorderedness and potential non-determinism for something as simple as PURE SCHEME is too weird. Scheme is about having-fun-with-programming, not about fun-for-compiler-writers. Let's fix the order of evaluation! GO LEFT-TO-RIGHT! :-) -- Matthias