| Steele, G. L., Lambda: the ultimate declarative. MIT Artificial Intelligence Memo 379, Cambridge, Massachusetts, November 1976. |
....current variable bindings) 1 This operation is called closure. We speak of the resulting procedure as being a closure. In fact, we shall consider them to be synonymous in this paper. Closures are a useful programming feature. They can be used to express data abstractions [1] to implement actors[7,8] and also to implement classes and provide data protection [9] The work of Atkinson and Morrison[10] discusses their usefulness in implementing modules, separate compilation and database views. Closures have also been used to represent code in a Scheme compiler [11,12] Unfortunately, ....
....due to the cost involved in allocating and maintaining variables on the heap. This inefficiency can be avoided in certain situations by allocating environments on the control stack. This can be performed by a clever compiler when it detects that the environment s existence is bounded[3,7]. Consider the expression: lambda (x) lambda (z) z) lambda (y) x y) When the closure resulting from the evaluation of this expression is called, a closure that uses the closed variable x is returned. The frame containing the variable x must be allocated from the heap because there is ....
Steele, G. L., Lambda: the ultimate declarative. MIT Artificial Intelligence Memo 379, Cambridge, Massachusetts, November 1976.
....can also be used to simulate closures in conventional dialects of Lisp. KEY WORDS Closure implementation Compiling Lisp Scheme Published in: Journal of Computer Languages, Vol. 17, No. 4, pp. 251 267, Pergamon Press, 1992. 1 INTRODUCTION In many lexically scoped dialects of Lisp, e.g. Scheme[1 3], T[4,5] and Common Lisp[6] procedures are first class objects. They are defined by expressions of the form (lambda formal argument list body) The formal argument list declares the variables that will contain the actual argument values when the procedure is later called and the body ....
.... expressions) and calls to an interactive compilation procedure to express expressions. Compilation of expressions consists of source to source transformations followed by the compilation of the resulting simpler forms. This is similar to the way macros are processed in many Lisp compilers[3,13,14]. Compilation is performed at two levels: statically for the compilation of the expression and dynamically for each evaluation of the expression (i.e. in the generation of each closure) Each closure generated is actually a piece of code. This clearly departs from the conventional ....
[Article contains additional citation context not shown here]
Steele, G. L., Rabbit: a compiler for Scheme. MIT Artificial Intelligence Memo 474, Cambridge, Massachusetts, May 1978.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC