> "setjmp" and "longjmp" are the mechanism for implementing exceptions in C
Correct, but reductive.
They can be used for many other things.
Correct, but reductive.
They can be used for many other things.
While the most frequent use of explicit continuations is for implementing exceptions, you are right that there are many other programming techniques based on explicit continuations (for instance coroutines).
The underlying primitive offers even more flexibility, but exceptions (in the sense of programming languages) can also be used for many other things than exceptions (in the sense of natural language, to handle exceptional cases).
Can you elaborate? What are the other ways exceptions are used when not used to handle exceptional situations?