4 Comments
User's avatar
Dr. Robert van Engelen's avatar

Nice! Forgot computed goto's in C existed. I suppose I banned them from my brain, as they are non-standard. I'm curious what happens when jumping to labels across other functions? BTW long jumps (longjmp) are still useful to me, such as to implement exceptions in an interpreter of a functional language to exit deep calls. But that's another story.

Expand full comment
Taras Tsugrii's avatar

as I've mentioned this "feature" is not part of C++ standard, so it's not something I'd encourage to use often, but it's often used to implement threaded interpreters - https://www.usenix.org/legacy/publications/library/proceedings/jvm01/gagnon/gagnon_html/node4.html

Expand full comment
Yacob Cohen-Arazi's avatar

interesting! thanks.

Expand full comment
Taras Tsugrii's avatar

you're always very welcome! Thank you for taking time to provide your feedback - it's always very much appreciated!

Expand full comment