skip to main content
10.1145/1190216.1190230acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

First-class nonstandard interpretations by opening closures

Published:17 January 2007Publication History

ABSTRACT

We motivate and discuss a novel functional programming construct that allows convenient modular run-time nonstandard interpretation via reflection on closure environments. This map-closure construct encompasses both the ability to examine the contents of a closure environment and to construct a new closure with a modified environment. From the user's perspective, map-closure is a powerful and useful construct that supports such tasks as tracing, security logging, sandboxing, error checking, profiling, code instrumentation and metering, run-time code patching, and resource monitoring. From the implementor's perspective, map-closure is analogous to call/cc. Just as call/cc is a non-referentially-transparent mechanism that reifies the continuations that are only implicit in programs written in direct style, map-closure is a non-referentially-transparent mechanism that reifies the closure environments that are only implicit in higher-order programs. Just as CPS conversion is a non-local but purely syntactic transformation that can eliminate references to call/cc, closure conversion is a non-local but purely syntactic transformation that can eliminate references to map-closure. We show how the combination of map-closure and call/cc can be used to implement set! as a procedure definition and a local macro transformation.

References

  1. W. Clinger, D. P. Friedman, and M. Wand, "A scheme for a higher-level semantic algebra," in Algebraic Methods in Semantics, J. Reynolds and M. Nivat, Eds. Cambridge University Press, 1985, pp. 237--250. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. E. Wengert, "A simple automatic derivative evaluation program," Comm. of the ACM, vol. 7, no. 8, pp. 463--4, 1964. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. W. K. Clifford, "Preliminary sketch of bi-quaternions," Proceedings of the London Mathematical Society, vol. 4, pp. 381--395, 1873.Google ScholarGoogle ScholarCross RefCross Ref
  4. J. C. Reynolds, "Definitional interpreters for higher-order programming languages," in Proceedings of the 25th ACM National Conference, 1972, reprinted in Higher Order and Symbolic Computing, 11(4):363--397, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. L. Steele, Jr. and G. J. Sussman, "Lambda, the ultimate imperative," MIT Artificial Intelligence Laboratory, A. I. Memo 353, Mar. 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. Johnsson, "Lambda lifting: Transforming programs to recursive equations," in Functional Programming Languages and Computer Architecture. Nancy, France: Springer-Verlag, Sept. 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. W. Clinger and J. Rees, Revised4 Report on the Algorithmic Language Scheme, Nov. 1991.Google ScholarGoogle Scholar
  8. D. MacQueen, "Modules for Standard ML," in Proceedings of the 1984 ACM Symposium on LISP and Functional Programming, Austin, TX, 1984, pp. 198--207. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Kiczales, J. Lamping, A. Menhdhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin, "Aspect-oriented programming," in Proceedings of the European Conference on Object-Oriented Programming, 1997, pp. 220--242.Google ScholarGoogle Scholar
  10. J. McCarthy, "A basis for a mathematical theory of computation," in Computer Programing and Formal Systems, P. Braffort and D. Hirschberg, Eds.Amsterdam: Elsevier North-Holland, 1963.Google ScholarGoogle Scholar
  11. J. M. Siskind and D. A. McAllester, "Screamer: A portable efficient implementation of nondeterministic CommonLisp," University of Pennsylvania Institute for Research in Cognitive Science, tech. report IRCS-93-03, 1993.Google ScholarGoogle Scholar
  12. ------, "Nondeterministic Lisp as a substrate for constraint logic programming," in Proceedings of the Eleventh National Conference on Artificial Intelligence, July 1993, pp. 133--8.Google ScholarGoogle Scholar

Index Terms

  1. First-class nonstandard interpretations by opening closures

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!