Date: Sat, 18 May 2013 12:40:04 -0700 From: Matt Birkholz <m...@birkholz.chandler.az.us>
> From: Taylor R Campbell <campb...@mumble.net> > Date: Fri, 17 May 2013 03:13:38 +0000 > > Scheme48 has a working implementation of this. When C calls into > Scheme, it passes Scheme a token and a return-to-c continuation to > which Scheme must return the token. [...] That would be cool. I have often pondered such a scheme, but I would be anxious to get out of C space and into Scheme. Thus I would re-apportion the work thusly: C calls into Scheme (as usual). The Scheme callback-handler notes the new state of the C stack, applies the chosen handler (with optional thread switching), waits until the C stack has returned to the noted state (if necessary), and returns. That is basically what I implemented in my follow-up with message-id <20130517183947.bebb060...@jupiter.mumble.net>. I think a slightly more sophisticated callback-handler is all you need. Why write *any* more C code? :-) Scheme48 has a working implementation of this, and it involves some nontrivial logic in C. I don't yet understand why, but until I do understand I'm going to assume that there is some reason it's necessary. I would guess it has something to do with handling throws by longjmp. _______________________________________________ MIT-Scheme-devel mailing list MIT-Scheme-devel@gnu.org https://lists.gnu.org/mailman/listinfo/mit-scheme-devel