[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: left to right order of evaluation
- To: JAR@MIT-MC
- Subject: Re: left to right order of evaluation
- From: Rodney A. Brooks <BROOKS%MIT-OZ@MIT-MC.ARPA>
- Date: Wed 21 Nov 84 15:52:49-EST
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Message from "Jonathan A Rees <JAR @ MIT-MC>" of Wed 21 Nov 84 15:27:00-EST
I think JAR is correct that there is no explicit mention of left to right
order of evaluation in the CL manual. However on page 99 of the
aluminum edition there are the following two paragraphs:
"In generalized-variable references such as shift, incf, push and
setf of ldb, the generalized variables are both read and written
in the same reference. Preserving the source program order of
evaluation and the number of evaluations is particularly important.
As an example of these semantic rules, in the generalized-variable
reference (setf reference value) the value must be evaluated
@i(after) all the subforms of the reference because the value form
appears to the right of them."
And then on page 102 in discussing defsetf there is a sentence:
"The implementation of defsetf takes care of ensuring that subforms
of the reference are evaluated exactly once and in the proper
left-to-right order."
So if the official position is that order is not defined then the above
pieces of the manual are bogus.
Is there any rational reason not to insist on left to right evaluation?
(Note that LET insists (page 110) on evaluating the value forms which
the variables get bound to left to right, so any optimiztion and side
effect mechanisms analysis stuff already needs to be built to make
let super efficient.)
-------