Implementing scope in an interpreter using shift/reset for delimited continuations: https://blog.moertel.com/posts/2005-09-13-scope-herding-with-delimited-continuations.html It's arguably overkill for the problem, but it's a well-argued introduction to shift and reset.