Changes between Initial Version and Version 1 of UnwindSemantics

Show
Ignore:
Timestamp:
06/18/10 21:18:14 (12 years ago)
Author:
whiteknight
Comment:

+create

Legend:

Unmodified
Added
Removed
Modified
  • UnwindSemantics

    v1 v1  
     1Rakudo has need of exit handlers for subroutines. These are events, such as cleanup tasks, that should be executed whenever a control flow leaves a block. 
     2 
     3= Exit Events = 
     4 
     5Here are some events that could cause control flow to leave a block: 
     6 
     7 - Invoking the return continuation 
     8 - Invoking any other continuation 
     9 - Throwing an exception 
     10 - Calling another function, which either invokes a continuation or throws an exception, and jumps somewhere else 
     11 - Tailcalling another function 
     12 
     13= Strategies = 
     14 
     15 - We could attach exit handlers to the context, and execute the handlers when the return continuation is invoked. This does not work well with continuations or exceptions which bypass the return continuation 
     16 - We could wrap the return continuation in a Sub that executes the exit handlers and then calls the return continuation. Same as above, this does not work with continuations or exceptions that bypass the wrapped retcontinuation