Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Re: weird common lisp feature [sic] Message-ID: <1991Feb26.195029.16776@Think.COM> Date: 26 Feb 91 19:50:29 GMT References: <964@creatures.cs.vt.edu> <1991Feb23.072613.9565@Think.COM> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 30 In article kers@hplb.hpl.hp.com (Chris Dollin) writes: >Where does CLtL guarentee L-to-R order of evaluation? [I've looked in CLtL I, >and didn't find anything that did guarantee L-R, but I could have missed it. I >*did* find 5.2.2, p61, which talks about when a function represented by a >lambda-expression is applied to some arguments and says the args and the >parameters are *processed* L-R; but that doesn't mean they have to be >*evaluated* L-R. Does it?] I was hoping no one would remember this. CLtL never comes right out and says that arguments are evaluated left-to-right. However, there are enough references to "the usual left-to-right order" that it is clear that this was an oversight. For example, CLtL p.194, when describing how the order of processing of arguments to arithmetic functions may be rearranged according to associativity and commutativity, says that this doesn't change the order of evaluation, which "is always left to right, as in all Common Lisp function calls." And, p.97 says, "SETF carefully arranges to preserve the usual left-to-right order in which the various subforms are evaluated." Interestingly enough, CLtL2 doesn't seem to have corrected this oversight. However, another passing reference was added: p.75 says, "while the arguments in a function call are always evaluated in strict left-to-right order, ...". The use of the word "while" implies that this clause is restating an already-established fact. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar