Re:Maybe Everything Is a Coroutine
by madsbuch on Wednesday February 14, 2024 @06:45AM
(#39368766)
Can you give an example of languages with resumable exceptions (just want to check it out)?
[ Parent
| on HN ]
Racket
Re:Maybe Everything Is a Coroutine
by Findecanor on Wednesday February 14, 2024 @09:04AM
(#39369861)
Common Lisp, Smalltalk, Ruby, Elixir, ...
A handler for a resumable exception is passed down the call stack, rather than an object being passed up the call stack to the handler. In some languages the handler can conditionally decide whether to resume back into or restart the block that raised the exception, or to cause an unwinding of the stack. In other languages, the action is fixed per exception type. (`try ... rescue`)