3 ms·
This is just a guess, but perhaps something like: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html http://www.chiark.greenend.org.uk/~sgtatham/corout
by mikeash 11y ago
This is just a guess, but perhaps something like: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
- jhallenworld 11y agoThis 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.
- nraynaud 11y agoI just used it a few minutes ago: https://github.com/nraynaud/webgcode/blob/gh-pages/interpolator/main.c#L150 https://github.com/nraynaud/webgcode/blob/gh-pages/interpola... https://github.com/nraynaud/webgcode/blob/gh-pages/interpolator/cnc.h#L111 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.