[clean-list] Transform to CPS

Claus Reinke claus.reinke@talk21.com
Tue, 4 Feb 2003 21:37:30 -0000


Erik Zuurbier writes:
> Hi cleaners
> 
> Does anybody of you know of a systematic way to transform a function (and
> its context) to a version using continuations 

Yup. It's called, surprisingly, the CPS transform. Probably every
intermediate functional programmer should know how to beat a simple 
function into CPS in their pet language. If you know Scheme, I'd suggest 
you pick up a copy of "Essentials of Programming Languages" by 
Friedman, Wand and Haynes, and read it cover to cover, or, if you're lazy, 
just skip to those later chapters. 

If you're into the history of ideas, there is a paper by Reynolds called 
"The Discoveries of Continuations", and also one called "Definitional
Interpreters", that you should be able to find on the web. 
 
-- 
-- Brian