Frank> Along similar lines: I have a Twelf top-level function in Frank> server that should interrupt the current computation and return Frank> to the Twelf top-level, not to an ML debugger or the ML Frank> top-level. I saw the documentation on signals, but I don't see Frank> how to achieve the desired effect because the handler will be Frank> run in a different thread.
I was just thinking about this the other day. I don't think it's currently possible in PolyML to handle asynchronous events - the garbage collector probably assumes it can't happen. So the best approximation I came up with was to code a trivial signal handler in C that sets an "interrupted" flag and checking that flag periodically in my main loop.
Of course, that assumes you have an identifiable "main loop" other than the toplevel ...