[plt-scheme] Continuations and expression evaluation

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Feb 17 07:38:19 EST 2009

On Feb 17, 2009, at 6:20 AM, James Coglan wrote:

> ... in the Scheme spec it says that operands are to be evaluated in  
> an unspecified order. ...

Here is the meaning of this statement. Say you have an application  
with several subexpressions

  (M n K)

and at least two of them are NOT values yet, say, M and K. Then the  
compiler can arrange two different sequences

  evaluate M, store away value m
  evaluate K, store away value k
  test that m is a function and then call m{n,k}

OR

  evaluate K, store away value k
  evaluate M, store away value m
  test that m is a function and then call m{n,k}

Now take a look at your program and check whether it contains such an  
application. NB, application includes such things as (+ 1 2).


-- Matthias



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090217/8c871930/attachment.html>

Posted on the users mailing list.