4 ms·
Delimited continuations reify the rest of the block as a function. From within the definition of a continuation you can use all variables in scope together with
by Tarean 9y ago
Delimited continuations reify the rest of the block as a function. From within the definition of a continuation you can use all variables in scope together with that function and can mash them together however you want.
You can reimplement low level control flow with this but generally it is mostly useful as a reinversion of control. Some code (like async IO) expects callbacks so you lose control over the program flow which makes composition difficult. You can reinverse this by using futures which often just wrap continuations.