[racket] metacircular interpreter, lexical scope, environment

From: YC (yinso.chen at gmail.com)
Date: Wed Dec 1 21:52:20 EST 2010

Thanks David, please see inline.

On Wed, Dec 1, 2010 at 6:09 PM, David Van Horn <dvanhorn at ccs.neu.edu> wrote:

>> This is not entirely true, but substitution and effects are subtle.

I can see that it works if things are by-reference, but by-value will appear
to be broken, no?

>     * it does not address closure
> You don't need closures in a substitution model.

Not sure if I understand what you mean, but I mean I need to implement
closure, and substitution does not appear to have advantage over simply
stuffing the values into the environment for a delayed evaluation in an

Perhaps a better rephrase for the whole question is:  what's a good place to
hold the values needed for the interpreter to perform
substitution/evaluation?  In the environment?  In the call frame?  I am
getting the feeling that I need my own call frame and stack even in an
minimal interpreter.

 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?
> I'm not exactly sure what you mean about your own call stack.  The
> environment and the control stack are separate issues.

I agree that they are separate issues, but as the implementer I need to
consider them together to have a full solution.  I.e. what are all of the
components I need to implement in order to have a minimal interpreter
(primitive types, lambda, define, set, quote, if) without using Racket's
built-in eval.

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

Posted on the users mailing list.