Higher-Order and Symbolic Computation, 18(3/4)

Fixing Letrec: A Faithful Yet Efficient Implementation of Scheme's Recursive Binding Construct

Oscar Waddell, Dipanwita Sarkar and R. Kent Dybvig, Indiana University, Bloomington

Abstract: A Scheme letrec expression is easily converted into more primitive constructs via a straightforward transformation given in the Revised^5 Report. This transformation, unfortunately, introduces assignments that can impede the generation of efficient code. This article presents a more judicious transformation that preserves the semantics of the revised report transformation and also detects invalid references and assignments to the left-hand-side variables, yet enables the compiler to generate efficient code. A variant of letrec that enforces left-to-right evaluation of bindings is also presented and shown to add virtually no overhead.

This article is not yet available.

[picture of journal cover]

June 2006 - hosc@brics.dk