chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Is it possible to emulate a port in chicken?


From: felix winkelmann
Subject: Re: [Chicken-users] Is it possible to emulate a port in chicken?
Date: Sat, 5 Mar 2005 12:05:51 +0100

On Fri, 04 Mar 2005 15:35:23 +0000, Julian Morrison
<address@hidden> wrote:
> By emulating a port, I mean: creating a "fake" port object which hands
> off reads and writes to callback functions. That would allow new sorts
> of ports to be defined in libraries eg: TLS port. At the moment I can't
> see any way to do this. Is there one? I assume worst case I could use
> FFI to muck about with chicken's internal port representation.
> 
> Also, suggestion: add a library call that reverses the posix library's
> (port->fileno) to allow a FD to be wrapped in a port. This is useful eg:
> in circumstances where a FD is inherited from the parent process, such
> as in programs called by inetd.

The `extras' unit has `make-input-port' and `make-output-port'.
See: 

http://www.call-with-current-continuation.org/manual/Input_002fOutput-extensions.html#Input_002fOutput-extensions


cheers,
felix




reply via email to

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