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

> In D, this is done with scope guard

Which is nowhere near as good, as the closing operation has to be setup explicitly. Go has the same issue with `defer`.



The various tradeoffs between try-finally, RAII, and scope guard is discussed here:

http://www.d-programming-language.org/exception-safe.html

Scope guard has a number of distinct advantages.




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

Search: