User:P.maistrenko/sandbox

Resumable Exception Handling Resumable exception handling is one of two approaches to exception handling in programming languages. It allows, after exception, handling, returning execution point to the statement where the exception arose. It contrasts with non-resumable exception handling prevalent in the programming languages.

Concept
In traditional non-resumable exception handling, when an exception it triggered, the program control point unwinds the stack of function calls, until an appropriate exception handler is found,

The after execution the exception handler and returns control to the calling function. Execution resumes in the calling function at the point immediately following the call of the stacked functions. Effectively, it terminates execution of code in the called function.

This is related to the so-called resumption model of exception handling, in which some exceptions are said to be continuable: it is permitted to return to the expression that signaled an exception, after having taken corrective action in the handler. The condition system is generalized thus: within the handler of a non-serious condition (a.k.a. continuable exception), it is possible to jump to predefined restart points (a.k.a. restarts) that lie between the signaling expression and the condition handler. Restarts are functions closed over some lexical environment, allowing the programmer to repair this environment before exiting the condition handler completely or unwinding the stack even partially.

rather than unwinding the stack immediately, it sends a signal back through which is picked up at a higher level. Then that higher level gets to tell the lower level how to proceed. This seems neat, since as the speaker points out, you don't lose your state while asking the higher levels how to handle the condition.

Since I have not come across this before, it raised a few questions:

How well does this work in practice and are there any caveats? Could this have been used in more mainstream languages (Java, c#, etc)? Do other languages handle exceptions in this way?

Support in Programming Languages
LISP BASIC

Criticism
the part about how Lisp handles error conditions. If I understand correctly, rather than unwinding the stack immediately, it sends a signal back through which is picked up at a higher level. Then that higher level gets to tell the lower level how to proceed. This seems neat, since as the speaker points out, you don't lose your state while asking the higher levels how to handle the condition.

Since I have not come across this before, it raised a few questions:

How well does this work in practice and are there any caveats? Could this have been used in more mainstream languages (Java, c#, etc)? Do other languages handle exceptions in this way?

Links
https://www.BBBtutorialspoint.com/lisp/lisp_error_handling.htm https://softwareengineering.stackexchange.com/questions/80336/do-resumable-exceptions-make-any-sense http://www.gigamonkeys.com/book/beyond-exception-handling-conditions-and-restarts.html http://lambda-the-ultimate.org/node/1544 https://books.google.com.ua/books?id=Gh_ZEvpazfcC&pg=PA728&lpg=PA728&dq=lisp+resumable+exceptions&source=bl&ots=Ih7g_-stuB&sig=ACfU3U2_t7RPPIaDm2FMvFw4bKHk38Gebw&hl=ru&sa=X&ved=2ahUKEwiI9qyPjcfoAhUGr4sKHa_FDloQ6AEwEHoECAwQLA#v=onepage&q=resumable%20exception&f=false