Methods

finallyΒΆ

finally(body:Fun, cleanup:Fun)

TODO: make sure cleanup() is not run twice in case of exception in cleanup() itself
Source: stdlib.ngs:879

body

Main code to execute

cleanup

Cleanup code to execute

Returns

Whatever body call returns

Example

finally(
  { while entry = c_readdir(d) { ... } },
  { ... c_closedir(d) ...}
)