Skip to main content

Predicate dispatching: A unified theory of dispatch

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1445))

Abstract

Predicate dispatching generalizes previous method dispatch mechanisms by permitting arbitrary predicates to control method applicability and by using logical implication between predicates as the overriding relationship. The method selected to handle a message send can depend not just on the classes of the arguments, as in ordinary object-oriented dispatch, but also on the classes of subcomponents, on an argument's state, and on relationships between objects. This simple mechanism subsumes and extends object-oriented single and multiple dispatch, ML-style pattern matching, predicate classes, and classifiers, which can all be regarded as syntactic sugar for predicate dispatching. This paper introduces predicate dispatching, gives motivating examples, and presents its static and dynamic semantics. An implementation of predicate dispatching is available.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Eric Amiel, Olivier Gruber, and Eric Simon. Optimizing multi-method dispatch using compressed dispatch tables. In Proceedings OOPSLA '94, pages 244–258, Portland, OR, October 1994.

    Google Scholar 

  2. Daniel G. Bobrow, Ken Kahn, Gregor Kiczales, Larry Masinter, Mark Stefik, and Frank Zdybel. Commonloops: Merging lisp and object-oriented programming. In Proceedings OOPSLA '86, pages 17-29, November 1986. Published as ACM SIGPLAN Notices, volume 21, number 11.

    Google Scholar 

  3. Craig Chambers. Object-oriented multi-methods in Cecil. In O. Lehrmann Madsen, editor, Proceedings ECOOP '92, LNCS 615, pages 33–56, Utrecht, The Netherlands, June 1992. Springer-Verlag.

    Google Scholar 

  4. Craig Chambers. The Cecil language: Specification and rationale. Technical Report UW-CSE-93-03-05, Department of Computer Science and Engineering. University of Washington, March 1993.

    Google Scholar 

  5. Craig Chambers. Predicate classes. In O. Nierstrasz, editor, Proceedings ECOOP '93, LNCS 707, pages 268–296, Kaiserslautern, Germany, July 1993. Springer-Verlag.

    Google Scholar 

  6. Craig Chambers and Gary T. Leavens. Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems, 17(6):805–843, November 1995.

    Article  Google Scholar 

  7. Weimin Chen, Volker Turau, and Wolfgang Klas. Efficient dynamic lookup strategy for multi-methods. In M. Tokoro and R. Pareschi, editors, Proceedings ECOOP '94, LNCS 821, pages 408–431, Bologna, Italy, July 1994. Springer-Verlag.

    Google Scholar 

  8. J. Hamer, J.G. Hosking, and W.B. Mugridge. A method for integrating classification within an object-oriented environment. Technical Report Auckland Computer Science Report No. 48, Department of Computer Science, University of Auckland, October 1990.

    Google Scholar 

  9. J.G. Hosking, J. Hamer, and W.B. Mugridge. Integrating functional and object-oriented programming. In Technology of Object-Oriented Languages and Systems TOOLS 3, pages 345–355, Sydney, 1990.

    Google Scholar 

  10. Paul Hudak, Simon Peyton Jones, Philip Wadler, Brian Boutel, Jon Fairbairn, Joseph Fasel, Maria Guzman, Kevin Hammond, John Hughes, Thomas Johnsson, Dick Kieburtz, Rishiyur Nikhil, Will Partain, and John Peterson. Report on the programming language Haskell, version 1.2. SIGP-LAN Notices, 27(5), May 1992.

    Google Scholar 

  11. Paris C. Kanellakis and John C. Mitchell. Polymorphic unification and ML typing. In ACM-SIGPLAN ACM-SIGACT, editor, Conference Record of the 16th Annual ACM Symposium on Principles of Programming Languages (POPL '89), pages 105–115, Austin, TX, USA, January 1989. ACM Press.

    Google Scholar 

  12. Gregor Kiczales and Luis Rodriguez. Efficient method dispatch in PCL. Technical Report SSL 89-95, Xerox PARC Systems Sciences Laboratory, 1989.

    Google Scholar 

  13. Warwick B. Mugridge, John Hamer, and John G. Hosking. Multi-methods in a statically-typed programming language. In P. America, editor, Proceedings ECOOP '91, LNCS 512, pages 307–324, Geneva, Switzerland, July 15–19 1991. Springer-Verlag.

    Google Scholar 

  14. Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, 1990.

    Google Scholar 

  15. Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In Conference Record of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 146–159, January 1997.

    Google Scholar 

  16. Guy L. Steele Jr. Common Lisp: The Language. Digital Press, Bedford, MA, 1990. Second edition.

    Google Scholar 

  17. Antero Taivalsaari. Object-oriented programming with modes. Journal of Object-Oriented Programming, pages 25–32, June 1993.

    Google Scholar 

  18. Philip Wadler. Views: A way for pattern matching to cohabit with data abstraction. In Proceedings of the Fourteenth Annual ACM Symposium on Principles of Programming Languages, pages 307–313, Munich, Germany, January 1987.

    Google Scholar 

  19. John M. Zelle. Learning search-control heuristics for logic programs: Applications tospeed-up learning and languageacquisitions. Technical Report AI93-200, University of Texas, Austin, May 1, 1993.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Eric Jul

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ernst, M., Kaplan, C., Chambers, C. (1998). Predicate dispatching: A unified theory of dispatch. In: Jul, E. (eds) ECOOP’98 — Object-Oriented Programming. ECOOP 1998. Lecture Notes in Computer Science, vol 1445. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0054092

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-64737-9

  • Online ISBN: 978-3-540-69064-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics