Abdulaziz Ghuloum and R. Kent Dybvig. Implicit phasing for R6RS libraries, Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, 303-314, September, 2007 (bibtex).
The forthcoming Revised Report on Scheme differs from previ- ous reports in that the language it describes is structured as a set of libraries. It also provides a syntax for defining new portable li- braries. The same library may export both procedure and hygienic macro definitions, which allows procedures and syntax to be freely intermixed, hidden, and exported.
This paper describes the design and implementation of a portable version of R6RS libraries that expands libraries into a core language compatible with existing R5RS implementations. Our implementation is characterized by its use of inference to de- termine when the bindings of an imported library are needed, e.g., run time or compile time, relieving programmers of the burden of declaring usage requirements explicitly.