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

Obj-C ARC could do this with NS_VALID_UNTIL_END_OF_SCOPE, but Swift only has withExtendedLifetime(), which is probably more typing than just using defer.

(The ObjC version would break if you ever threw an exception, ARC doesn't release objects during unwinding!)



> withExtendedLifetime(), which is probably more typing than just using defer.

with..., arrow down, enter.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: