Unlike the previous approaches, the latest implementation is generic. Shift and control share all the
same code, and differ in only one boolean flag. Therefore, it becomes
possible to mix different control operators in the same
program. Furthermore, the latest implementation is direct rather than
emulation (in terms of an object-level shift), therefore, it has the
best performance. The code is surprisingly simple, compared with the
previous implementation of 'control' by Sitaram and Felleisen, and
does not require equality on continuations. All four delimited control
operations do indeed reduce to call/cc and one global mutable cell,
and hence have a quite simple CPS transform. That has been known since
the paper by Chung-chieh Shan (Scheme Workshop, 2004). The current
code shows that result more directly.
Oleg's implementation provides all four Friedman-Felleisen delimited control operators: from -F- (similar to cupto) to +F- (aka control) to +F+ (aka shift). The R5RS Scheme code is parameterized by two boolean flags: is-shift and keep-delimiter-upon-effect. All four combinations of the two flags correspond to four delimited control operators.
Recent comments
27 weeks 1 day ago
27 weeks 1 day ago
27 weeks 1 day ago
49 weeks 2 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago