Czar
10/03/2017, 12:10 PMuse
execution both first and second will be closed, so the object becomes unusable. I'm sorry for so many uses of the word 'use', but here I kinda have to 😄marstran
10/03/2017, 12:56 PMuse
function, instead of implementing manually. The whole implementation would be this: first.use { a -> second.use { b -> useBlock(a, b) } }
.Czar
10/03/2017, 1:11 PMmarstran
10/03/2017, 1:16 PMuse
function in UsablePair
could just be what I wrote in my last comment. You don't really need that big try-catch statement.beholder
10/03/2017, 1:30 PMmarstran
10/03/2017, 1:31 PMCzar
10/03/2017, 1:57 PMuse
. Wanted to see how implementation from scratch would look like.