Re: Quick question about SRFI-170 directory-files
Lassi Kortela 29 Jul 2019 18:57 UTC
> Gambit unifies such generators using ports. For example, another interesting one are FIFOs:
>
> And another one is tcp-server ports whose elements are the connections received at the indicated interface and port number:
Very interesting approach! I never got to use Gray streams in Common
Lisp but this seems similar?
> Unifying generators through ports has the advantage of a single way to control waiting on the next value (rather than having a different API depending on the nature of the generator). In Gambit you can call (input-port-timeout-set! port timeout [thunk]) to set an action to perform if a read operation waits for longer than a certain amount of time. There’s also (output-port-timeout-set! port timeout [thunk]) for situations where writes may have to wait.
Very nice detail. This didn't occur to me at all. Does Gambit have a
cooperative thread scheduler, and does this timeout handling tie into
it? (I regret being completely unfamiliar with Gambit's internals, as
with those of most other Schemes.)