[racket] metacircular interpreter, lexical scope, environment

From: Hendrik Boom (hendrik at topoi.pooq.com)
Date: Wed Dec 1 23:25:24 EST 2010

On Wed, Dec 01, 2010 at 10:34:48PM -0500, David Van Horn wrote:
> On 12/1/10 10:14 PM, Hendrik Boom wrote:
>> On Wed, Dec 01, 2010 at 09:09:04PM -0500, David Van Horn wrote:
>>> On 12/1/10 9:03 PM, YC wrote:
>>>> 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
>>>
>>> This is not entirely true, but substitution and effects are subtle.
>>
>> The actual prblem is that the parameter is reevaluated every time it's
>> used in teh called function.  THis lacke efficiency, but occasionally
>> (as in Algol 60's call-by-name it's exactly what you need,)
>>
>>>
>>>>      * it does not address closure
>>>
>>> You don't need closures in a substitution model.
>>
>> No, as long as you take care to use systematic renaming of variables.
>
> You luck out and get to avoid this issue if you implement a  
> call-by-value language.

You still have it if parameters can be functions.

-- hendrik


Posted on the users mailing list.