chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] basic Scheme question


From: Shawn Rutledge
Subject: Re: [Chicken-users] basic Scheme question
Date: Fri, 24 Oct 2008 10:20:12 -0700

On Fri, Oct 24, 2008 at 1:00 AM, Drake Wilson <address@hidden> wrote:
> Quoth Shawn Rutledge <address@hidden>, on 2008-10-23 23:54:03 -0700:
>> > Eval only sees the top-level environment.  It may be possible to use
>> > the environments egg to construct your own environment containing v.
>>
>> I thought of that, but also thought there must be a generic Scheme way
>> to do this.
>
> From someone with admittedly limited Scheme knowledge:
>
> The generic Scheme way wouldn't involve passing around quoted names and
> expecting them to retain their associations to the original lexical symbols
> at runtime, because they generally don't.
>
> The generic Scheme way would probably be to have a function encapsulate the
> idea of reading and writing the variable inside a "location" structure of
> some sort (pair of get+set function, likely) and then have the other function
> interact with that.

Right that's the usual pattern.  But I'm trying to call it remotely.

A client REPL opens an SSH connection to a server and starts a server
REPL.  Each of them evaluates what the other sends.  So if the server
sends
(let ([v (make-thing)])
   ...)
and the client evaluates it, then later the server wants to ask the
client to do any operation on the previously-created v, how can the
client now access the variable v, which exists only in that
environment created by "let"?  Just binding it to a top-level name
would pollute the namespace.  Having to bind the accessor is not so
bad, because the same accessor can be used to modify multiple remote
objects.




reply via email to

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