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
I need to play around. Don't trust there is a lawful conversion for any expr. For ex : (throw new Exception).catch(???)
1 reply 0 retweets 0 likes -
Replying to @Devastated_mind
That would work exactly the same as try { throw new Exception() } catch { ... }
1 reply 0 retweets 0 likes
Replying to @propensive @Devastated_mind
(except that in Scala 2 it would require an additional allocation, and you would get an additional stack frame...)
3:20 PM - 6 Mar 2020
0 replies
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.