[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Manual does say left to right


     It turns out that The Book *does* explicitly specify that argument
forms are evaluated from left to right; but not, unfortunately, in any
place as obvious as page 61.  If you look on page 194, 3rd full
paragraph, you will find:

	   For functions that are mathematically associative (and 
	possibly commutative), a Common Lisp implementation may
	process the argumants in any manner consistent with assoc-
	iative (and possibly commutative) rearrangement.  This does
	not affect the order in which the argument forms are eval-
	uated, of course; that order is always left to right, as in
	all Common Lisp function calls. ...

This section is clearly talking about evaluating argument forms as
distinct from processing arguments.  Page 61, on the other hand is
talking only about processing arguments.  The meaning of page 61 can
be clarified by juxtaposing it with part of page 58:

	[p. 58] ... Any and all remaining elements of the list are
	forms to be evaluated; one value is obtained from each form,
	and these values become the *arguments* to the function.  The
	function is then *applied* to the arguments. ... [p. 61] When
	the function represented by the lambda-expression is applied
	to the arguments, the arguemnts and parameters are processed
	in order from left to right. ...

(Isn't textual criticism fun?  I knew those Comp Lit courses weren't
for nothing. :-))

-- Jeff Dalton
   AI Applications Institute
   University of Edinburgh