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

[plt-scheme] Call/cc problem



Sorry for asking such a general question on this list...I have 
troubles with my ISP sending to comp.lang.scheme, so I hope perhaps 
here someone can help me:

My MzScheme application A communicates with the front-end B (written in
another language) by exchanging commands. In order to do that, B can
call a top-level receiver function of A in a modified
read-eval-print-loop, while A has a function (send-command cmd) for
sending something to B.

The problem: Both A and B are non-blocking, independent operating system
processes, but I need A to be able to send commands synchronously, ie. I
need a function (send/sync-command cmd) that sends cmd to B, waits until
B has replied with another command, returns the reply and then continues
like if an ordinary function had been called.

I've tried to store continuations in an object and let them be called by
the receiver function, but I get "continuation application: attempted to
cross a continuation boundary" when using call/cc, and "continuation
application: attempt to jump into an escape continuation" when using
call/ec.

I've taken a look at  Ferguson/Deugo: "Call with Current Continuation 
Patterns", 2001, but  unfortunately, the paper is already a little 
above my head. Could anyone outline me how to tackle this problem?

Regards,

Erich