http://www.perlmonks.org?node_id=251315


in reply to Re: Re: Re: Re: Re: (Perl6) Groking Continuations
in thread (Perl6) Groking Continuations

So you could have it both ways: the finally block is done every time, and the restore code on a temp variable is done only when it's gone for good?

But, I think many C++ programmers think of using the former for the purpose of the latter. Especially any code that wants to undo/fixate things by playing with the caller's blocks (as mentioned in earlier discussions) it needs to be clear that setting up something triggered when a variable goes out of scope (e.g. restore from a temp) is not the same as code that's simply inserted just before the close brace of that scope. Earlier, your comments about doing without prompt destruction made me think that we would indeed be using the "finally"-like mechanism for that purpose.

  • Comment on Re: Re: Re: Re: Re: Re: (Perl6) Groking Continuations