chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] making environments


From: felix
Subject: Re: [Chicken-users] making environments
Date: Wed, 11 Aug 2004 13:51:00 +0200
User-agent: Opera M2/7.52 (Win32, build 3834)

On Wed, 11 Aug 2004 12:41:15 +0200, Thomas Chust <address@hidden> wrote:

Michele Simionato wrote:
 > [...]
#;> (require-extension environments)
#;> (define my-env (make-environment))
#;> (environment-copy (interaction-environment) my-env)
Error: can not copy interaction environment
 So, how do I go? It would be enough for me to start
from a r5rs-like environment. The problem is that
make-environments returns a completely empty environment
which is not what I want (I want to evaluate Scheme
code in this environment).

Shouldn't it suffice to do
        (define my-env (scheme-report-environment 5)) ?
This is even R5RS compliant and doesn't need the environments extension. It also fullfills
        (equal? my-env (scheme-report-environment 5)) => #f
as soon as you changed something in my-env.


That is correct. The interaction-environment is a special case
(it contains an environment-table of the value #f). The way to do
it is to create a (scheme-report-environment 5) and add
all necessary bindings (either programmatically and for that you indeed
need the environments extension, or via eval).


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]