use std impl disposable int = __dispose__ = {n std.put("Disposing of {}\n", n) } ;; type cleanup = (-> void) const cleanup = { f; -> (f: cleanup) } impl disposable cleanup = __dispose__ = {f: cleanup; f()} ;; const f = {b var x = 1 auto x++ if b -> void ;; auto x++ } const g = {n auto (40 + 2) while n > 0 auto n-- if n <= 0 -> void ;; auto n-- ;; } const main = { auto cleanup({ std.put("Tchuss!\n"); }) f(true) std.put("-- \n") f(false) std.put("-- \n") g(2) std.put("-- \n") g(3) }