3 karma · joined Feb 19, 2025 (1y ago) · 2 submissions
comment 1y ago · link · parent
It's not Go then
def bracket[A, T](ctor: () -> A, next: (a: A) -> T): T = val a = ctor(); try { return next(a) } finally { a.dispose() }