[racket] metacircular interpreter, lexical scope, environment

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Wed Dec 1 21:08:31 EST 2010

Then you're ready to read the Felleisen-Hieb semantics to understand
how to handle state (and just about everything else in the universe).

It's a tour de force, which is why I don't recommend it to beginners:
they usually have no idea what it's saying or why it matters.  But
your questions suggest you're at just the right point.


On Wed, Dec 1, 2010 at 9:03 PM, YC <yinso.chen at gmail.com> wrote:
> On Wed, Dec 1, 2010 at 5:25 PM, David Van Horn <dvanhorn at ccs.neu.edu> wrote:
>> 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.
>> 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.
> 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:
> it only work with side-effect free code
> it does not address closure
> 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?
> Thanks,
> yc
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.