I know that i should not write code that depends on this, but i'm
curious as to whether The Definition (CLtL2) has anything to say about
it. Do we always get the following behavior?
> (+ (print 1) (print 2))
1
2
3
rodrigo vanegas
··@cs.brown.edu
ps. yes, i rtfm'ed. (twice!)
In article <···············@costello.cs.brown.edu> ··@cs.brown.edu (rodrigo vanegas) writes:
>I know that i should not write code that depends on this, but i'm
>curious as to whether The Definition (CLtL2) has anything to say about
>it. Do we always get the following behavior?
>
> > (+ (print 1) (print 2))
> 1
> 2
> 3
Yes, Common Lisp requires car-to-cdr evaluation of function arguments.
Finding it in CLtL is difficult, though. I believe the description of SETF
mentions that the standard SETF expanders maintain "the normal
left-to-right argument evaluation order." This implies that left-to-right
argument evaluation order is normal.
The dpANS says it right out.
--
Barry Margolin
System Manager, Thinking Machines Corp.
······@think.com {uunet,harvard}!think!barmar