4 ms·
> 1. deterministic destructors that run at the end of functions (therefore making things that look like tail calls not actually tail calls) and Couldn't owned
by derefr 14y ago
> 1. deterministic destructors that run at the end of functions (therefore making things that look like tail calls not actually tail calls) and
Couldn't owned boxes (~) passed through the jump transfer their ownership to the next frame (so they'll be destructed by whoever finally does return), and everything else just get destructed before the jump?
- pcwalton 14y agoYeah, we discussed the possibility of doing this. But we eventually decided that it wasn't worth it due to these issues: * It's surprising behavior for destructors, which can have side effects. C++/D RAII and try/finally in other languages never behave like this. * You can do it yourself, by moving the values-to-be-destructed into the bit bucket with "let _ = ..."; * You still have the ABI issues in that you can't use cdecl and have to use Pascal/stdcall to get TCO.