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

Adopted from go, first appeared in D, invented by one of its major developers, Andrei Alexandrescu.




P.S. In D it's `scope(exit)` = defer, `scope(failure)` = Zig's errdefer, and `scope(success)` -- which no one else has and which I have made good use of. e.g., I have a mixin that traces entry and exit from a function, the latter with scope(success). If I use scope(exit) instead then when an exception is thrown all the leave messages are printed and then the stack trace, rather than seeing the stack trace at the point of failure (this baffled me when it first happened).

I vaguely remember reading somewhere recently that Andrei left the D community / foundation. Do you know if that is true?




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

Search: