A Selective CPS Transformation

Authors

  • Lasse R. Nielsen

DOI:

https://doi.org/10.7146/brics.v8i30.21690

Abstract

The CPS transformation makes all functions continuation-passing, uniformly. Not all functions, however, need continuations: they only do if their evaluation includes computational effects. In this paper we focus on control operations, in particular ``call with current continuation'' and ``throw''. We characterize this involvement as a control effect and we present a selective CPS transformation that makes functions and expressions continuation-passing if they have a control effect, and that leaves the rest of the program in direct style. We formalize this selective CPS transformation with an operational semantics and a simulation theorem à la Plotkin.

Downloads

Published

2001-07-04

How to Cite

Nielsen, L. R. (2001). A Selective CPS Transformation. BRICS Report Series, 8(30). https://doi.org/10.7146/brics.v8i30.21690