Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Actions aren't called at :outer sub exit

0 views
Skip to first unread message

Bob Rogers

unread,
Mar 4, 2006, 9:06:03 PM3/4/06
to Perl 6 Internals
This is because the fact of being an :outer sub promotes its
context's C<RetContinuation> to a C<Continuation>, whether or not it
ever creates a closure. When the C<Continuation> is invoked to return,
it does no unwinding, leaving the control stack untouched on exit. The
action is effectively popped (and leaked, I'll wager), but it is never
executed.

To illustrate the problem, the attached mod to the "pushaction, sub
exit" case is sufficient to prevent the action from ever being called.

Turning C<RetContinuation> into a non-agressive "use at most once"
continuation as suggested on 4-Feb-06 (see L<http://xrl.us/jwtt>) would
certainly fix the problem, by avoiding the need for context promotion
altogether. So that would be another bug fixed by this proposal.
Unfortunately, I have even less time to put into it now, so I have
decided to work around it for the time being.

-- Bob Rogers
http://rgrjr.dyndns.org/

closure-action-failure.patch
0 new messages