2 ms·
It's important that there are two very different approaches to control flow manipulation. They differ in when the target of a jump is bound. - Static binding o
by mafribe 10y ago
It's important that there are two very different approaches to control flow manipulation. They differ in when the target of a jump is bound.
- Static binding of location to jump to. This is what goto, callcc, while, for etc. do.
- Dynamic binding of location to jump to. This is what exceptions do.
You can show that they are really different, in the sense that (in the absence of powerful language features), they cannot simulate each other, see [1]. Once you realise that exceptions and gotos are quite different thinking about error handling becomes more clearer.
[1] J. G. Riecke, H. Thielecke, Typed Exceptions and Continuations Cannot Macro-Express Each Other.
- deleted 10y ago[deleted]
- hvidgaard 10y agoI accidently hit downvote on your post, and I cannot undo it. I hope some kind soul will upvote you to counter. Your post has solid information for the topic at hand.
- brian_cloutier 10y agoThat's a really cool result, thanks for pointing it out!