2 research outputs found

    Typed Closure Conversion for Recursively-Defined Functions (Extended Abstract)

    Get PDF
    Closure conversion is a critical program transformation for higher-order languages that eliminates lexically nested, first-class functions or procedures. In particular, closure conversion translates each function definition f into a closure -- a data structure consisting of a pointer to closed code and another data structure which represents the environment or context of the function. The code abstracts the arguments of f as well as the free variables of f, and the environment provides the values for the free variables of f. Function application is translated to a sequence which invokes the code of the function's closure on the environment of the closure and the arguments. Since the code is closed and separated from the data which it manipulates, it may be defined..
    corecore