Will it CPS? 0 ▲ Abstract Heresies 1 hour ago · 25 min read5053 words · Tech · hide · 0 comments Continuation-passing style (CPS) is a programming style in which you pass one or more first-class procedures (continuations) to a function as arguments. When the function is done, it doesn't return a value in the usual way, but delegates to one of the continuations, passing it the result. This is a powerful technique because all control flow, no matter how complex, can be expressed in terms of continuations. Judicious application of continuation-passing style can solve some pretty gnarly problems, but unrestrained use of CPS can make code very hard to read and understand. Most computer languages cannot effectively support continuation-passing style. You need first-class procedures, which implies garbage collection, you need proper tail recursion so that you can set up unbounded delegation chains, and you either need dynamic typing or a very sophisticated static type system that can handle the complex higher-order types that arise in continuation-passing style. While Common Lisp does… No comments yet. Log in to reply on the Fediverse. Comments will appear here.