I admit, if it's possible, it would be open door to bad, very bad code... But in some specific cases...
So the question is, is there any equivalent of c setjmp/longjmp ?
I would like to implement a python-like generator without using threads, just saving the stack and the context, and restore it later.
Simple answer: No there is not! The closest thing you can get are labeled breaks, which are a kind of forward jumps to break out of multiple nested blocks, but thats it!