Instead of writing, def fn() = { val result = someExpression doSomethingElse() result } I've found myself writing code like, def fn() = try someExpression finally doSomethingElse() more, even when `someExpression` is pure. I'm not entirely sure how I feel about it.
-
-
Replying to @propensive
why not `def fn() = {doSomethingElse(); someExpression}` if `someExpression` is pure?
2 replies 0 retweets 2 likes
Replying to @etorreborre
Oh, good point! I said "pure" only to save characters in my tweet: what I meant was specifically, "doesn't throw exceptions"...
11:29 AM - 19 Mar 2021
from Frankfurt on the Main, Germany
0 replies
0 retweets
1 like
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.