[plt-scheme] Self evaluating "objects"

From: Jos Koot (jos.koot at telefonica.net)
Date: Mon Jul 14 10:55:58 EDT 2008

There are environments and environments. A scheme report environment has 
nothing to do with the environment that is catched by a procedure in as 
construct like
(let ((var expr) ...) (lambda (arg ...) expr)))
and the environment that is used by eval. In PLT the scheme report 
environments are called namespaces. As far as I know there is no way of 
catching the LOCAL environment of the above lambda form. Or may be there is: 
making a syntax that cashes the origin of its calls and making eval a syntax 
that uses the cached origin to expand the expression to be evaluated (not 
trivial though). But I cannot find any reason to prepare such tools.
----- Original Message ----- 
From: "Cristian Baboi" <cristian.baboi at gmail.com>
To: "Chongkai Zhu" <czhu at cs.utah.edu>
Cc: "Jos Koot" <jos.koot at telefonica.net>; <plt-scheme at list.cs.brown.edu>
Sent: Monday, July 14, 2008 4:39 PM
Subject: Re: [plt-scheme] Self evaluating "objects"

> On Mon, 14 Jul 2008 17:25:41 +0300, Chongkai Zhu <czhu at cs.utah.edu> wrote:
>> Cristian Baboi wrote:
>>> Some more examples:
>>> (begin
>>> (define x 3)
>>> (eval 'x (scheme-report-environment 5))
>>> )
>>> (begin
>>> (define x 3)
>>> (eval 'x (interaction-environment))
>>> )
>>> both return 3 in Gambit-C, but the first gives "reference to undefined 
>>> identifier: x" in PLT
>> Your previous post does show that PLT is not comform to R6RS. But this 
>> one isn't. 'x is defined in interaction-environment but not 
>> scheme-report-environment.
>> Chongkai
> It was not my intention to show that PLT is not conform to R6RS!
> I only try to see how I can use scheme to evaluate dynamic generated code.
> This code does not work for example:
> (define (c)
>   (let ((x 3))
>     (eval 'x ))
> )
> (c)
> I know how to quote some code, but I cannot see how I can "unquote" it. 

Posted on the users mailing list.