Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!ukma!rex!samsung!zaphod.mps.ohio-state.edu!uwm.edu!bionet!agate!cork.Berkeley.EDU!xjam From: xjam@cork.Berkeley.EDU (Brian F. Dennis) Newsgroups: comp.lang.scheme Subject: Re: semantics of procedure calls Message-ID: <1991Feb28.232008.26348@agate.berkeley.edu> Date: 28 Feb 91 23:20:08 GMT References: <1991Feb28.230440.1762@Neon.Stanford.EDU> Sender: usenet@agate.berkeley.edu (USENET Administrator) Reply-To: xjam@cork.Berkeley.EDU (Brian F. Dennis) Organization: University of California, Berkeley Lines: 33 In article <1991Feb28.230440.1762@Neon.Stanford.EDU>, hasan@eclipse.stanford.edu (Waqar Hasan) writes: |> I am new to Scheme and my source of information is the R^3 report on Scheme. |> [stuff deleted] |> I would like to seek clarification on the semantics of procedure calls. |> The report states that arguments to a procedure are evaluated in an |> "indeterminate order". |> |> Does this mean any particular evaluation should be equivalent to some |> serial order or are there no restrictions? |> |> Example: Consider (f (+ e1 e2) (+ e3 e4)) |> The order of evaluation e3, e4, e1, e2 is a serialization |> since it corresponds to evaluating the second argument and then the |> first argument. |> The order e1, e3, e4, e2 on the other hand is not (in general) equivalent to |> to any serial evaluation of the arguments. The problem is that e1, e3, e4, and e2 are NOT arguments of f. The expressions (+ e1 e2) and (+ e3 e4) are the arguments to f. Those expressions will be evaluated in an indeterminate order, corresponding to your first statement, which is the correct interpretation. Similarly, within in each plus call, the arguments will be evaluated in an indeterminate order. |> -Waqar Hasan |> hasan@hplabs.hp.com, 415-857-4233 They can't come on and play me in prime time, |Crossjammer ...... OUT! Cause I know the time, cause I'm gettin' mine. |xjam@yew.berkeley.edu I get on the mix late in the night... <-------------------PUBLIC ENEMY