Continuation-Passing Style (CPS)
Direct style
CPS transform
n:
Run
Step
Reset
CPS: every function takes extra k (continuation). Tail calls replace the call stack. Direct style builds up stack frames; CPS uses a chain of continuations.