Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.scheme Subject: Re: Order of evaluation (was Re: evaluating () should be an error Message-ID: <4375@skye.ed.ac.uk> Date: 28 Mar 91 18:47:32 GMT References: <2977@kraftbus.cs.tu-berlin.de> <1991Mar26.155905.12906@daffy.cs.wisc.edu> <1991Mar26.224805.23381@cs.ubc.ca> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 35 What it comes down to is that Scheme is the sort of language that doesn't specify such things. The greater range of optimizations available when the order of argument evaluation is not specified is not, in my view, a sufficient reason for not specifying the order. Indeed, a compiler would often be able to reorder anyway, becuase it could often tell that some expressions involve no side effects. There are already compilers that perform that sort of analysis, at least to some extent. So I do not think the efficiency gains, though real, are sufficiently great. As additional, though not necessarily convincing, evidence, I will note that Common Lisp does specify the order of evaluation, yet I have not heard loud complaints that it is a massive blow to efficiency there. Here are 2 arguments in favor of specifying the order of argument evaluation: 1. Programs will be more portable. Since bugs related to argument order can be difficult to find, this may represent a significant savings in programmers' time, which is more important than machine cycles. 2. The operation of the program will be more closely related to the structure of the source text. (Assuming, of course, that the specified order is left-to-right.) Moreover, LET* will be used to accomplish one thing (values of later variables depend on values of earlier ones) rather than two (as before plus sequential computation of the values). These arguments are not, of course, conclusive; but then neither are the counterarguments. In the end, it becomes a question of which factors are considered most important. For Scheme, one of them was the desire to move in the direction of the Algol/C family. -- jd