|
|
|
|
|
by cstrahan
2566 days ago
|
|
Not Java or Python, but here’s some Ruby: https://www.honeybadger.io/blog/how-to-try-again-when-except... The above article talks about exploiting Ruby's support for call/cc to do something similar. A noteworthy difference: Ruby's support for call/cc is baked into it's runtime, while in Haskell you can implement call/cc as a normal library. This is done by leaning on Haskell's monadic "do" syntax and a suitable implementation of the Monad class. http://hackage.haskell.org/package/mtl-2.2.2/docs/Control-Mo... I'm rooting from my phone, so I can't type up a this-vs-that. But maybe that piques your interest and you can read up on Haskell and programming with monads. |
|