Thunks (Continued)

Call-by-name can be simulated in a call-by-value setting using \thunks" (i.e., parameterless procedures) or continuation-passing-style (CPS). In this paper we uncover a relationship between the two simulations. We prove that the call-by-value CPS transformation Cv, when applied to a term T (t) which simulates call-by-name using thunks, yields a term identical to the call-by-name CPS transformation Cn applied directly to t (modulo renaming): Cv T Cn This result sheds new light on the call-by-name CPS transformation | it can be factored into two conceptually distinct steps: the suspension of argument evaluation (captured in T); the sequentialization of function application to give the usual tail-calls of CPS terms (captured in Cv).