3 ms·
In fact, the addition is almost a subtraction. To make restartable exceptions to work, all you need is a way to search for points without unwinding the stack, a
by kazinator 8y ago
In fact, the addition is almost a subtraction. To make restartable exceptions to work, all you need is a way to search for points without unwinding the stack, and invoke closures there.
In TXR Lisp, I unified conditions and restarts into a single mechanism, which is called exceptions.
There are two kinds of handling frames: ones for which an unwinding takes place first, and ones which just intercept the search. Both are identified by an exception symbol which exists in an inheritance hierarchy.
It's all documented in detail here: http://nongnu.org/txr/txr-manpage.html#N-0146B946 http://nongnu.org/txr/txr-manpage.html#N-0146B946
There are dialect notes comparing with ANSI CL, and an example program shown in both TXR Lisp and a CL translation for comparison.