Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I understand the feature correctly, D has this via scope(failure) [1]

``` void func() { scope(failure) writeln("Something went wrong!"); } ```

[1] https://tour.dlang.org/tour/en/gems/scope-guards



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: