delimc icon indicating copy to clipboard operation
delimc copied to clipboard

Nested resets

Open trptcolin opened this issue 10 years ago • 0 comments

My understanding of shift/reset is that the innermost reset delimits the continuation capture. But the README issue that @skatenerd opened shows that a shift inside a nested reset appears to capture outside of its reset delimiter.

This solution macroexpands any nested reset expressions, so the CPS transform proceeds in a new context during that macroexpansion (which will recursively transform its result). Then the CPS transform will continue, using the macroexpansion result. I'm not 100% confident in this solution, since this is my first deep dive into the CPS transform, but it does pass the existing tests and the updates to the nesting test that I made.

Note: this PR is on top of my other one that makes delimc usable via require.

trptcolin avatar Mar 11 '14 01:03 trptcolin