This is just a guess, but perhaps something like: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
I just used it a few minutes ago: https://github.com/nraynaud/webgcode/blob/gh-pages/interpola...
https://github.com/nraynaud/webgcode/blob/gh-pages/interpola...
One problem is the reset of the functions, I just created a makeshift exception, but I don't know how far I want to deviate form the norm.
I still don't know if it's a good idea, but that's what personal projects are for.
Re:Tom Duff on Duff's Device (1988)
by jhallenworld on Saturday September 05, 2015 @11:35PM
(#10176759)
This is a very useful technique for making event driven parsers. I remember being surprised that the case statements didn't all have to be in the same scoping level, but it's true.
I'm really, really curious about what that code is.