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 do find try / catch redundant with Try{ ... }.recover{ ... }. The expression is needed at they language level but the Try type can also implement the expression.
1 reply 0 retweets 1 like
Replying to @joseph_ausmann
Yes, I agree. You could (almost) make `Try` an implicit class, and you would get my suggested syntax. But the main point was that the `recover` or `catch` could be "called" directly on the expression.
6:15 PM - 6 Mar 2020
0 replies
0 retweets
2 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.