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

What it does is complicate things rather a lot. Continuations are an old, old language feature. Unfortunately many folks doing language work didn't think about then when new language features were developed, so there are things which may not necessarily play well with continuations. They'll work, but may not be an optimal combination.

In the block exit case, finally clauses will be executed each block exit, which may be somewhat surprising, but not fundamentally an issue. The bigger issue is with things like local/temp/hpyothetical variables.

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

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: (Perl6) Groking Continuations
by John M. Dlugosz (Monsignor) on Apr 17, 2003 at 19:40 UTC
    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.