<br><div class="gmail_quote">On Wed, Dec 1, 2010 at 5:25 PM, David Van Horn <span dir="ltr"><<a href="mailto:dvanhorn@ccs.neu.edu">dvanhorn@ccs.neu.edu</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5">
<br></div></div>
An evaluator can implement function application using substitution, i.e. you can evaluate ((lambda (x) e) v) by evaluating the substitution of v for x in e.<br>
<br>
Or, you can be lazy and defer the substitution. In that case, you evaluate ((lambda (x) e) v) by evaluating e; you just have to remember that v should have been substituted for x should you ever get to evaluating x. The data structure you use to remember those deferred substitutions is an environment. A simple list of variable, value pairs is a suitable representation.<br>
</blockquote><div><br></div><div>Thanks - I have read the substitution part of PLAI and thought of using substitution as well, but it seems that substitution does not constitute the full solution: </div><div><ul><li>it only work with side-effect free code </li>
<li>it does not address closure </li></ul><div>Maybe I am looking too far ahead, but it seems like I cannot get away from needing my own call stack? Or am I missing something? </div></div><div><br></div><div>Thanks,</div>
<div>yc</div><div><br></div></div>