Re:Java 21 makes me like Java again
by insanitybit on Saturday September 16, 2023 @06:44PM
(#37539541)
I assume `Go` would have to be Closeable and you'd still need the try-with-resources, right?
[ Parent
| on HN ]
You don't need a try-with-resources, you can manually call close if you want, or has to work in a non-lexical scope.
But you often want the concurrently running threads to return some results, that try-with-resources is part of the structured concurrency that helps you with closing off a branching point, similarly to how we use while loops instead of gotos. `go` in itself corresponds to `goto` basically, with many of the same negatives.
Re:Java 21 makes me like Java again
by ivan_gammel on Sunday September 17, 2023 @01:00AM
(#37541673)
Maybe you re-read my comment, check the signature of Go::go() and think again?