[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Order of evaluation in PUSH (& PUSHNEW)
I agree that the letter and spirit of CLtL strongly suggest that
the order of evaluation should be left to right. This is so mainly
because that is the way things normally go in Common Lisp, and so
the programmer must expect that behavior unless explicitly told not
to.
However, specifying strict left to right order of evaluation kills a
substantial amount of parallelism in argument evaluation. At least,
it makes it harder to recognize when the arguments of a function
call can be parallelized.
I am almost sure this has been raised before and probably the
original committee even considered this, but as I am new to the list,
I haven't seen this discussed: Was it ever considered to leave the
order of evaluation in function calls unspecified (or less
restricted) than in the current version? I am thinking of something
along the lines of saying that, except for special forms, other
evaluable forms are evaluated by:
1- determining the function to call or macro to expand.
2- computing the arguments, if a function.
3- calling the function (or (eval (macroexpand....))).
1- and 2- could go in parallel, or 1- could be guaranteed to occur
before 2-.
It is obvious that certain forms have no meaning but for an order of
evaluation (progn,...) and others need special rules for whether an
argument even gets eval'd (and, or, ...). But that's why all of
these forms are 'special', and pure applicative thinking [:-)] makes
it unnecessary to depend on the order of evaluation for the normal
function calls. I suspect that the original committee had a really
good reason to tie up this part of the language, but I cannot think
of one...
=Cesar
(Of course, if this has been hashed time and again, please just
point me to the relevant archives.)
--------
Cesar Augusto Quiroz Gonzalez
Department of Computer Science {allegra|seismo}!rochester!quiroz
University of Rochester or
Rochester, NY 14627 quiroz@cs.rochester.edu