Skip to main content
Log in

A semantics of introspection in a reflective prototype-based language

  • Published:
LISP and Symbolic Computation

Abstract

In Malenfant et al. [19], we have described a reflective model for a prototype-based language based on thelookup o apply reflective introspection protocol. In this paper, we augment our previous protocol by converting it to handle continuations reified as first-class objects. First-class continuations provide much more control over the current computation; during the introspection phase fired by message sending, they make it possible not only to change the behavior of the program for that message but also for the entire future computation. In this paper, we provide this introspection protocol with a formal semantics. This result is obtained by exhibiting a mapping Δ from program configurations to priority rewrite systems (PRS) as well as a mapping from message expressions to ground first-order terms used to query the PRS. Other advantages of this approach are: to ensure the termination of the introspection using the smallest set of formally justified conditions and to provide a clear declarative account of this reflective protocol. The PRS also appears as a meta-level to the base language, independent of the implementation, but from which we derive fundamental clues to obtain an efficient language processor. By our new model, we finally highlight the link between reflection in object-oriented languages and the one originally proposed by 3-Lisp [24], although object-orientation provides reusability to reflection, making it easier to use.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. A.W. Appel.Compiling with Continuations. Cambridge University Press, 1992.

  2. J.M.C. Baeten, J.A. Bergstra, and J.W. Klop. Term Rewriting Systems with Priorities. InRewriting Techniques and Appl., number 256 in LNCS, pages 83–94. Springer-Verlag, 1987.

  3. P. Cointe. Metaclasses are First Class: the ObjVLisp Model.Proc. of OOPSLA'87, ACM Sigplan Notices, 22(12):156–167, December 1987.

    Google Scholar 

  4. O. Danvy and K. Malmkjaer. Intensions and Extensions in a Reflective Tower. InProc. of the 1988 ACM Symp. on Lisp and Functional Prog., pages 327–341, 1988.

  5. N. Dershowitz and J.-P. Jouannaud. Rewrite Systems. InHandbook of Theoretical Computer Science, chapter 6, pages 244–320. Elsevier Science Publishers, 1990.

  6. J. des Rivières. The Secret Tower of CLOS. InInformal Proc. of the First Workshop on Reflection and Metalevel Architectures in OOP, OOPSLA/ECOOP'90, October 1990.

  7. J. des Rivières and B. C. Smith. The implementation of procedurally reflective languages. InProc. of the 1984 ACM Symp. on Lisp and Functional Prog., pages 331–347, August 1984.

  8. C. Dony, J. Malenfant, and P. Cointe. Prototype-Based Languages: From a New Taxonomy to Constructive Proposals and Their Validation.Proc. of OOPSLA'92, ACM Sigplan Notices, 27(10):201–217, October 1992.

    Google Scholar 

  9. J. Ferber. Computational Reflection in Class Based Object-Oriented Languages.Proc. of OOPSLA'89, ACM Sigplan Notices, 24(10):317–326, October 1989.

    Google Scholar 

  10. B. Foote and R. E. Johnson. Reflective Facilities in Smalltalk-80.Proc. of OOPSLA'89, ACM Sigplan Notices, 24(10):327–335, October 1989.

    Google Scholar 

  11. U. Hölzle, B.-W. Chang, C. Chambers, and D. Ungar. The Self Manual, version 1.0. distributed with the Self software release, from Stanford University, July 1990.

  12. IEEE, New-York.IEEE Standard for the Scheme Programming Language, IEEE Std 1178–1990 edition, 1991.

  13. S. Jefferson and D.P. Friedman. “A Simple Reflective Interpreter,”Proceedings of the International Workshop on Reflection and Meta-Level Architecture, pp. 24–35 (November 1992), the extended version also appears in this volume.

  14. G. Kiczales. Making Reflection Safe for Real-World Users. InInformal Proc. of the First Workshop on Reflection and Metalevel Architectures in OOP, OOPSLA/ECOOP'90, October 1990.

  15. G. Kiczales, J. Des Rivières, and D. Bobrow.The Art of the Metaobject Protocol. MIT Press, 1991.

  16. J. Lamping, G. Kiczales, L. Rodriguez, and E. Ruf. An Architecture for an Open Compiler. In [28], pages 95–106.

  17. P. Maes. Concepts and Experiments in Computational Reflection.Proc. of OOPSLA'87, ACM Sigplan Notices, 22(12):147–155, December 1987.

    Google Scholar 

  18. J. Malenfant, P. Cointe, and C. Dony. Reflection in Prototype-Based Object-Oriented Programming Languages. InInformal Proc. of the Second Workshop on Reflection and Metalevel Architectures in OOP, OOPSLA'91, October 1991.

  19. J. Malenfant, C. Dony, and P. Cointe. Behavioral Reflection in a Prototype-Based Language. In [28], pages 143–153.

  20. A. Mendhekar and D.P. Friedman. Towards a Theory of Reflective Programming Languages. InInformal Proc. of the Third Workshop on Reflection and Metalevel Architectures in Object-Oriented Programming, OOPSLA'93, October 1993.

  21. C.K. Mohan. Priority Rewriting: Semantics, Confluence, and Conditionals. InRewriting Techniques and Applications, number 355 in LNCS, pages 278–291. Springer-Verlag, 1989.

  22. R. Muller. M-LISP: A Representation-Independent Dialect of LISP with Reduction Semantics.ACM TOPLAS, 14(4):589–615, October 1992.

    Google Scholar 

  23. C. Queinnec and P. Cointe. An Open-Ended Data Representation Model forEU_Lisp. InProc. of the 1988 ACM Symp. on Lisp and Functional Prog., pages 298–308. June 1988.

  24. B.C. Smith. Reflection and Semantics in Lisp. InProc. of the 14th Annual ACM Symposium on Principles of Programming Languages, pages 23–35, January 1984.

  25. D. Ungar and R. Smith. Self: The Power of Simplicity.Proc. of OOPSLA'87, ACM Sigplan Notices, 22(12):227–242, December 1987.

    Google Scholar 

  26. M. Wand and D. P. Friedman. The Mystery of the Tower Revealed: A Nonreflective Description of the Reflective Tower.Lisp and Symbolic Computation, 1(1):11–37, 1988.

    Google Scholar 

  27. T. Watanabe and A. Yonezawa. Reflection in an Object-Oriented Concurrent Language.Proc. of OOPSLA'88, ACM Sigplan Notices, 23(11):306–315, November 1988.

    Google Scholar 

  28. A. Yonezawa and B. Smith, editors.Proc. of the International Workshop on New Models for Software Architecture '92, Reflection and Meta-Level Architecture. RISE (Japan), ACM Sigplan, JSSST, IPSJ, November 1992.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Malenfant, J., Dony, C. & Cointe, P. A semantics of introspection in a reflective prototype-based language. Lisp and Symbolic Computation 9, 153–179 (1996). https://doi.org/10.1007/BF01806111

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01806111

Keywords

Navigation