Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!bronze!copper!harlan From: harlan@copper.ucs.indiana.edu (Pete Harlan) Newsgroups: comp.lang.scheme Subject: Re: Order of evaluation (was Re: evaluating () should be an error Message-ID: Date: 27 Mar 91 01:46:38 GMT References: <2977@kraftbus.cs.tu-berlin.de> <1991Mar26.155905.12906@daffy.cs.wisc.edu> <1991Mar26.224805.23381@cs.ubc.ca> Sender: news@bronze.ucs.indiana.edu (USENET News System) Organization: Indiana University Lines: 31 manis@cs.ubc.ca (Vincent Manis) writes: >In article kiran@copper.ucs.indiana.edu (Kiran >Wagle) writes: >>>Of course going to far in this direction might lead to specifying the >>>evaluation order of arguments to procedures, and I don't think that would be >>>good. >>Why not? >Because it can substantially impair the ability of a compiler to produce >high-quality code. [---demonstration of this omitted---] Clearly Scheme was designed from the start to be compiled efficiently :-) But another point: If I'm reading your code and come across ((foo) (a b) (c d)), I know that the three applications are completely independent (almost---Scheme doesn't allow them to be evaluated in parallel, presumably because of the nightmare of reasoning about call/cc and set! in such contexts). If subexpressions of a combination were necessarily evaluated in some order, then I wouldn't have any way of knowing, and you wouldn't have any way of expressing (short of a comment), that the computations didn't *need* to be evaluated in that order. It is simple enough to force order of evaluation when it is needed, and it is surprising how rarely that occurs. --Pete Harlan harlan@copper.ucs.indiana.edu