Is it a valid statement to say that with context p...
# language-evolution
a
Is it a valid statement to say that with context parameters you can actually recreate the suspend keyword? I mean, the suspend keyword provides a Continuation, but with context parameters you can provide a Continuation context.
j
Not really? The suspend keyword's primary purpose is to do the CPS transform so you don't have to handle continuations explicitly
a
Ah okay, there happens a lot more under the hood than passing a simple continuation of course
d
In particular, it converts the function from imperative to a state machine. Whenever a suspend function calls into another suspend function, it can be told to return immediately. The function will be called again with its new state once the function is resumed.