I was curious, does the ANS spec on Lisp define the order of evaluation for
function arguments? For example:
(defun foo-stack-sample (stack)
(- (pop stack) (pop stack)))
(foo-stack-example '(10 5)) => ?
Is this guaranteed to evaluate to 5 or -5 (either one)? Or should I stick
with using an intermediate variable as in C?
--
Best regards,
Jeff ··········@mfire.com
http://www.simforth.com
Jeff Massung wrote:
> Is this guaranteed to evaluate to 5 or -5 (either one)? Or should I stick
> with using an intermediate variable as in C?
Yes, it is assured. Arguments are evaluated left to right.
jimbo
;-)
Jeff Massung <···@NOSPAM.mfire.com> writes:
> I was curious, does the ANS spec on Lisp define the order of evaluation for
> function arguments?
They are evaluated left to right. This is at 3.1.2.1.2.3
Function Forms.