|
|
|
|
|
by kazinator
865 days ago
|
|
Continuations are closures because they capture everything that a closure would capture at the same point in the execution. But they also capture more. In CPS, continuations are often closures. But: those closures also close over the surrounding function's hidden continuation parameter k, and make essential use of it! The last continuation-lambda in the function has to call k to simulate the return. |
|