Does Scala even need the `try` keyword, and must `catch` be a keyword? I'd be happy to call `.catch(partialFunction)` directly on an expression or code block. It could be implemented as an extension method.
-
-
Replying to @propensive
If it's possible to implement as efficiently as normal try/catch, and to opt-out (so that `catch` can be provided as an extension in e.g. MonadError, which would be nice), then sure
1 reply 0 retweets 0 likes -
Replying to @kubukoz
Scala 3 could inline it, but Scala 2 would need an additional allocation and stack frame (or two...).
1 reply 0 retweets 0 likes -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
