chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] replacing the "write" function


From: felix winkelmann
Subject: Re: [Chicken-users] replacing the "write" function
Date: Fri, 5 Dec 2008 09:27:01 +0100

On Fri, Dec 5, 2008 at 5:31 AM, Shawn Rutledge
<address@hidden> wrote:
>
> Anyway, I need to detect that we are about to send a tinyclos object,
> and instead send the s-expression which when eval'd, will create the
> proxy for it instead.  I wish I didn't have to re-invent the "write"
> function to do that; I was hoping I could save off a pointer to it,
> create a new-write function, then (environment-set! env 'write
> new-write) on an environment in which the "display scheme program"
> (either server-side or client-side) is to run, but I'm not having much
> luck with that.  It is supposed to be possible, right?
>

An environment-specific hook into "write" doesn't exist, but you can
define a "print-object" method for your tinyclos objects (perhaps in
combination with SRFI-10 reader syntax) to print a tinyclos instance
in any way you want and have it read back in with whatever
prcoessing you require.


cheers,
felix




reply via email to

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