delimc
delimc copied to clipboard
Nested resets
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
.