Nov. 4, 2012
2:32 p.m.
On Nov 02, 2012, at 08:41 AM, Nick Coghlan wrote:
Go's "defer" is quite a neat solution for these hassles if anyone's in the mood for a time machine discussion.
Go was one of the reference points for the ExitStack design (it's a large part of why the API also supports providing callbacks directly to the exit stack, not just as context managers).
Is it fair to say that the difference between Go's defer and ExitStack is that the latter gives you the opportunity to clean up earlier than at function exit? Cheers, -Barry