Hacker News new | ask | show | jobs
by mikeash 3933 days ago
This is just a guess, but perhaps something like: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
2 comments

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.

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.