Recycling continuations

Citation
J. Sobel et Dp. Friedman, Recycling continuations, ACM SIGPL N, 34(1), 1999, pp. 251-260
Citations number
18
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
34
Issue
1
Year of publication
1999
Pages
251 - 260
Database
ISI
SICI code
1523-2867(199901)34:1<251:RC>2.0.ZU;2-C
Abstract
If the continuations in functional data-structure-generating programs are m ade explicit and represented as records, they can be "recycled."; Once they have served their purpose as temporary, intermediate structures for managi ng program control, the space they occupy can be reused for the structures that the programs produce as their output. To effect this immediate memory reclamation, me use a sequence of correctness-preserving program transforma tions, demonstrated through a series of simple examples. We then apply the transformations to general anamorphism operators, with the important conseq uence that all finite-output anamorphisms can now be run without any stack- or continuation-space overhead.