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

  • Authors:
  • Shinn-Der Lee;Daniel P. Friedman

  • Affiliations:
  • -;-

  • Venue:
  • POPL '93 Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.