Quasi-static scoping: sharing variable bindings across multiple lexical scopes

Static scoping embodies a strong encapsulation mechanism for hiding the details of program units. Yet, it does not allow the sharing of variable bindings (locations) across independent program units. Facilities such as module and object systems that require cross references of variables therefore must be added as special features. In this paper we present an alternative: quasi-static scoping. Quasi-static scoping is more flexible than static scoping, but has the same encapsulation mechanism. The user can control when and in what scope to resolve a quasi-static variable, i.e., to associate it with a variable binding. To demonstrate its versatility, we add quasi-static scoping to Scheme and show how to build the aforementioned facilities at the user-level. We also show that quasi-static scoping can be implemented efficiently.

[1]  Luca Cardelli,et al.  Compiling a functional language , 1984, LFP '84.

[2]  William D. Clinger,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[3]  Guy L. Steele,et al.  Common Lisp the Language , 1984 .

[4]  K. Nørmark SIMULATION OF OBJECT-ORIENTED CONCEPTS AND MECHANISMS IN SCHEME , 1990 .

[5]  James H. Morris Protection in programming languages , 1973, CACM.

[6]  Robin Milner,et al.  Definition of standard ML , 1990 .

[7]  James H. Morris Protection in Programming , 1973 .

[8]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[9]  Jonathan Rees,et al.  Object-oriented programming in scheme , 1988, LFP '88.

[10]  M.N. Sastry,et al.  Structure and interpretation of computer programs , 1986, Proceedings of the IEEE.

[11]  Matthias Felleisen,et al.  A Closer Look at Export and Import Statements , 1986, Comput. Lang..

[12]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[13]  Suresh Jagannathan,et al.  Metalevel building blocks for modular systems , 1994, TOPL.

[14]  James S. Miller,et al.  Free variables and first-class environments , 1991, LISP Symb. Comput..

[15]  Simon Peyton Jones,et al.  The Implementation of Functional Programming Languages (Prentice-hall International Series in Computer Science) , 1987 .

[16]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[17]  Barak A. Pearlmutter,et al.  Oaklisp: An object-oriented dialect of scheme , 1988, LISP Symb. Comput..

[18]  Pavel Curtis,et al.  A module system for scheme , 1990, LISP and Functional Programming.

[19]  John Lamping A unified system of parameterization for programming languages , 1988, LFP '88.