4 ms·
The Common Lisp condition system is actually just a dynamically-scoped hook system. Handlers are the actual hooks; conditions are the object that may trigger s
by phoe-krk 7y ago
The Common Lisp condition system is actually just a dynamically-scoped hook system.
Handlers are the actual hooks; conditions are the object that may trigger some of the hooks when they are signaled. Restarts are an addition on top of the hooks that allows for easier non-local transfer of control; they provide little that handlers do not provide unless you count the Lisp debugger - by design, the only way to leave the debugger is by using a restart.
In other words: no continuations here.
- shadowgovt 7y agoInteresting. I'm not sure I understand; what do the dynamically-scoped hooks lack that continuations would give you?
- phoe-krk 7y agoTo be frank, I do not know. I am not a continuation specialist or even an adept, so I cannot say myself; all I can say for sure is that a condition system can be implemented (and is actually implemented in practice) without any continuations, and therefore doesn't require the underlying language to support continuations. (Common Lisp, for example, purposefully doesn't have them in standard - see http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuations-original.html. http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuat...)
- sedachv 7y agoIn Common Lisp, you can only transfer control up the stack. With continuations, you get multiple stacks that you can transfer control between.