[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Implementing a remote REPL, can't see definitions
From: |
Nicolas Pelletier |
Subject: |
Re: [Chicken-users] Implementing a remote REPL, can't see definitions |
Date: |
Mon, 24 May 2010 13:37:19 +0900 |
Hello,
On Sun, May 23, 2010 at 5:12 AM, Stephen Eilert <address@hidden> wrote:
>
> However, I cannot evaluate any definitions from the rest of the
> program. It seems that I can create new ones, though.
Are you saying that the bindings established by the rest of the
program are not seen by eval ? If so, are you aware of the following
construct (taken from
http://community.schemewiki.org/?scheme-faq-misc#sicp) ?
((eval `(begin (define ,name #f)
(lambda (val) (set! ,name val)))
(interaction-environment))
value)
Piping the needed values through lambda as in the above will let you
control which definitions can be used, and might be enough for what
you are trying to achieve.
> I am not passing any other arguments to eval, so I suppose it is using
> (interaction-environment).
Correct. This means that a new interaction environment will be
generated each time eval is called.
Hope this helps,
--
Nicolas