Skip to main content

Efficient Multimethods in a Single Dispatch Language

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3586))

Abstract

Smalltalk-80 is a pure object-oriented language in which messages are dispatched according to the class of the receiver, or first argument, of a message. Object-oriented languages that support multimethods dispatch messages using all their arguments. While Smalltalk does not support multimethods, Smalltalk’s reflective facilities allow programmers to efficiently add them to the language. This paper explores several ways in which this can be done, and the relative efficiency of each. Moreover, this paper can be seen as a lens through which the design issues raised by multimethods, as well as by using metaobjects to build them, can be more closely examined.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Benoit, C., Caseau, Y., Pherivong, C.: Knowledge Representation and Communication Mechanisms in Lore. In: ECAI 1986, pp. 215–224 (1986)

    Google Scholar 

  2. Blake, D., Cook, S.: On Including Part Hierarchies in Object-Oriented Languages, with an Implementation in Smalltalk. In: Gjessing, S., Nygaard, K. (eds.) ECOOP 1988. LNCS, vol. 322, pp. 41–50. Springer, Heidelberg (1988)

    Chapter  Google Scholar 

  3. Bobrow, D.G.: The LOOPS Manual. Xerox Parc. (1983)

    Google Scholar 

  4. Bobrow, D.G., Kahn, K., Kiczales, G., Masinter, L., Stefik, M., Zdybel, F.: CommonLoops: Merging Lisp and Object-Oriented Programming. In: OOPSLA Proceedings (1986)

    Google Scholar 

  5. Bobrow, D.G., DeMichiel, L.G., Gabriel, R.P., Keene, S.E., Kiczales, G., Moon, D.A.: Common Lisp Object System Specification X3J13. In: SIGPLAN Notices, September 1988, vol. 23 (1988)

    Google Scholar 

  6. Bobrow, D.G., Kiczales, G.: The Common Lisp Object System Metaobject Kernel – A Status Report. In: Proceedings of the 1988 Conference on Lisp and Functional Programming (1988)

    Google Scholar 

  7. Bobrow, D.G., Gabriel, R.P., White, J.L.: CLOS in Context: The Shape of the Design Space. In: Paepcke, A. (ed.) Object-Oriented Programming: The CLOS Perspective. MIT Press, Cambridge (1993). http://www.dreamsongs.com/NewFiles/clos-book.pdf

    Google Scholar 

  8. Borning, A., O’Shea, T.: Deltatalk: An Empirically and Aesthetically Motivated Simplification of the Smalltalk-80 Language. In: Bézivin, J., Hullot, J.-M., Lieberman, H., Cointe, P. (eds.) ECOOP 1987. LNCS, vol. 276, pp. 3–12. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  9. Borning, A.H., Ingalls, D.H.H.: A Type Declaration and Inference System for Smalltalk. In: POPL Proceedings, pp. 133–141 (1982)

    Google Scholar 

  10. Boyland, J., Castagna, G.: Parasitic Methods: An Implementation of Multi Methods for Java. In: OOPSLA Proceedings (1997)

    Google Scholar 

  11. Bracha, G., Ungar, D.: Mirrors: design principles for meta-level facilities of object-oriented programming languages. In: OOPSLA Proceedings, pp. 331–344 (2004)

    Google Scholar 

  12. Brant, J., Foote, B., Roberts, D., Johnson, R.: Wrappers to the Rescue. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, p. 396. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  13. Bruce, K., Cardelli, L., Castagna, G., Leavens, G.T., Pierce, B.: On binary methods. Theory and Practice of Object Systems 1(3), 221–242 (1995)

    Google Scholar 

  14. Caseau, Y.: An Overview of Lore. IEEE Software 3(1), 72–73

    Google Scholar 

  15. Caseau, Y.: A Model for a Reflective Object-Oriented Language. SIGPLAN Notices 24(4), 22–24

    Google Scholar 

  16. Castagna, G.: Covariance and contravariance: Conflict without a cause. ACM Transactions on Programming Languages and Systems 17(3), 431–447 (1995)

    Article  Google Scholar 

  17. Chambers, C.: Object-Oriented Multimethods in Cecil. In: Lehrmann Madsen, O. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  18. Clifton, C., Leavens, G.T., Chambers, C., Millstein, T.: Proceedings of OOPSLA 2000. In: Proceedings of OOPSLA 2000, pp. 130–145 (2000)

    Google Scholar 

  19. Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)

    Google Scholar 

  20. Deutsch, L.P., Schiffman, A.M.: Efficient Implementation of the Smalltalk-80 System. In: Proceedings of the Tenth Annual ACM Symposiumon Principles of Programming Languages, pp. 297–302 (1983)

    Google Scholar 

  21. Feinberg, N., Keene, S.E., Mathews, R.O., Washington, P.T.: The Dylan Programming Book. Addison-Wesley Longman, Amsterdam (1996)

    Google Scholar 

  22. Foote, B., Johnson, R.E.: Reflective Facilities in Smalltalk-80. In: OOPSLA 1989 Proceedings, pp. 327–335 (1989)

    Google Scholar 

  23. Metadata. In: Proceedings of the Fifith Conference on Pattern Languages of Programs (PLoP 1998) Monticello, Illinois, Technical Report #WUCS-98025 (PLoP 1998/EuroPLoP 1998) Dept. of Computer Science, Washington University (August 1998)

    Google Scholar 

  24. Foote, B., Yoder, J.W.: Big Ball of Mud. In: Harrison, N., et al. (eds.) Patterns Languages of Program Design 4 (PLoPD4). Addison-Wesley, Reading (2000)

    Google Scholar 

  25. Gabriel, R.P., White, J.L., Bobrow, D.G.: CLOS: Integrating Object-Oriented and Functional Programming. Communications of the ACM 34 (1991)

    Google Scholar 

  26. Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addision-Wesley, Reading (1995)

    Google Scholar 

  27. Grothoff, C.: Walkabout revisited: The runabout. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  28. Goldberg, A., Kay, A. (eds.): with the Learning Research Group. Smalltalk-72 Instruction Manual. Xerox Palo Alto Research Center,

    Google Scholar 

  29. Goldberg, A., Robson, D.: Smalltalk-80: The Language and its Implementation. Addison-Wesley, Reading (1983)

    MATH  Google Scholar 

  30. Goldberg, A.: Smalltalk-80: The Interactive Programming Environment. Addison-Wesley, Reading (1984)

    MATH  Google Scholar 

  31. Goldberg, D.S., Findler, R.B., Flatt, M.: Super and inner: together at last! In: OOPSLA Proceedings 2004, pp. 116–129 (2004)

    Google Scholar 

  32. Hebel, K.J., Johnson, R.E.: Arithmetic and Double Dispatching in Smalltalk-80. Journal of Object-Oriented Programming 2(6), 40–44 (1990)

    Google Scholar 

  33. Daniel, H., Ingalls., H.: The Smalltalk-76 Programming System: Design and Implementation. In: 5th ACM Symposium on POPL, pp. 9–15 (1978)

    Google Scholar 

  34. Ingalls, D.H.H.: A simple technique for handling multiple polymorphism. In: Proceedings of OOPSLA 1986 (1986)

    Google Scholar 

  35. Johnson, R.E., Graver, J.O., Zurawski, L.W.: TS: An Optimizing Compiler for Smalltalk. In: OOPSLA 1988 Proceedings, pp. 18–26 (1988)

    Google Scholar 

  36. Kiczales, G., Rodriguez, L.: Efficient Method Dispatch in PCL. In: Proceedings of the ACM Conference on Lisp and Functional Programming, pp. 99–105 (1990)

    Google Scholar 

  37. Kiczales, G., Rivieres, J.d., Bobrow, D.G.: The Art of the Metaobject Protocol. MIT Press, Cambridge (1991)

    Google Scholar 

  38. Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, p. 327. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  39. Keene, S.E.: Object-Oriented Programming in Common Lisp: A Programmer’s Introduction to CLOS. Addison-Wesley, Reading (1989)

    MATH  Google Scholar 

  40. Krasner, G. (ed.): Smalltalk 80: Bits of History, Words of Advice. Addison-Wesley, Reading (1983)

    MATH  Google Scholar 

  41. Kristensen, B.B., Madsen, O.L., Moller-Pedersen, B., Nygaard, K.: Object-Oriented Programming in the Beta Language (1990)

    Google Scholar 

  42. LaLonde, W.R., Thomas, D.A., Pugh, J.R.: An Exemplar Based Smalltalk. In: OOPSLA 1986 Proceedings, Portland, OR, October 4-8, pp. 322–330 (1977)

    Google Scholar 

  43. Multiple Dispatch as Dispatch on Tuples. In: OOPSLA Proceedings, pp. 274–287 (1998)

    Google Scholar 

  44. McAffer, J.: Meta-level Programming with CodA. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 190–214. Springer, Heidelberg (1995)

    Google Scholar 

  45. Maes, P.: Computational Reflection. Artificial Intelligence Laboratory. Vrije Universiteit Brussel. Technical Report 87-2 (1987)

    Google Scholar 

  46. Maes, P.: Concepts and Experiments in Computational Reflection. In: OOPSLA 1987 Proceedings, pp. 147–155 (1987)

    Google Scholar 

  47. Moon, D.: Object-Oriented Programming with Flavors. In: OOPSLA 1986 Proceedings, pp. 1–8 (1986)

    Google Scholar 

  48. Mougin, P., Ducasse, S.: OOPAL: integrating array programming in object-oriented programming. In: OOPSLA Proceedings, pp. 65–77 (2003)

    Google Scholar 

  49. Mugridge, W., Hamer, J., Hosking, J.: Multi-Methods in a StaticallyTyped Programming Language. In: America, P. (ed.) ECOOP 1991. LNCS, vol. 512, pp. 147–155. Springer, Heidelberg (1991)

    Chapter  Google Scholar 

  50. Paepcke, A. (ed.): Object-Oriented Programming: The CLOS Perspective. MIT Press, Cambridge (1993)

    Google Scholar 

  51. Palsberg, J., Jay, C.B., Noble, J.: Experiments with Generic Visitors. In: The Proceedings of theWorkshop on Generic Programming, Marstrand, Sweden (1998)

    Google Scholar 

  52. Palsberg, J., Drunen, J.V.: Visitor oriented programming. In: The Workshop for Foundations of Object-Oriented Programming, FOOL (2004)

    Google Scholar 

  53. F. Rivard. Evolution du comportement des objets dans les langages a classes reflexifs. PhD thesis, Ecole des Mines de Nantes, France (June 1997)

    Google Scholar 

  54. Saltzer, J.H., Reed, D.P., Clark, D.D.: End-to-end arguments in system design. In: Second International Conference on Distributed Computing Systems, April, pp. 509–512 (1981)

    Google Scholar 

  55. Schärli, N., Black, A.P., Ducasse, S.: Object-oriented encapsulation for dynamically typed languages. In: OOPSLA Proceedings, pp. 130–149 (2004)

    Google Scholar 

  56. Smith, B.C.: Reflection and Semantics in Lisp. In: POPL Proceedings, pp. 23–35 (1984)

    Google Scholar 

  57. Stefik, M., Bobrow, D.G.: Object-Oriented Programming: Themes and Variations. AI Magazine 6(4), 40–62 (1986)

    Google Scholar 

  58. Bjarne Stroustrup.The C++ Programming Language. Addison-Wesley, Reading (1986)

    Google Scholar 

  59. Thorup, K.K.: Genericity in Java with virtual types. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 444–471. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  60. Ungar, D., Smith, R.B.: Self: The Power of Simplicity. In: OOPSLA 1987 Proceedings, pp. 227–242 (1987)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Foote, B., Johnson, R.E., Noble, J. (2005). Efficient Multimethods in a Single Dispatch Language. In: Black, A.P. (eds) ECOOP 2005 - Object-Oriented Programming. ECOOP 2005. Lecture Notes in Computer Science, vol 3586. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11531142_15

Download citation

  • DOI: https://doi.org/10.1007/11531142_15

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-27992-1

  • Online ISBN: 978-3-540-31725-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics