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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Benoit, C., Caseau, Y., Pherivong, C.: Knowledge Representation and Communication Mechanisms in Lore. In: ECAI 1986, pp. 215–224 (1986)
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)
Bobrow, D.G.: The LOOPS Manual. Xerox Parc. (1983)
Bobrow, D.G., Kahn, K., Kiczales, G., Masinter, L., Stefik, M., Zdybel, F.: CommonLoops: Merging Lisp and Object-Oriented Programming. In: OOPSLA Proceedings (1986)
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)
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)
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
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)
Borning, A.H., Ingalls, D.H.H.: A Type Declaration and Inference System for Smalltalk. In: POPL Proceedings, pp. 133–141 (1982)
Boyland, J., Castagna, G.: Parasitic Methods: An Implementation of Multi Methods for Java. In: OOPSLA Proceedings (1997)
Bracha, G., Ungar, D.: Mirrors: design principles for meta-level facilities of object-oriented programming languages. In: OOPSLA Proceedings, pp. 331–344 (2004)
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)
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)
Caseau, Y.: An Overview of Lore. IEEE Software 3(1), 72–73
Caseau, Y.: A Model for a Reflective Object-Oriented Language. SIGPLAN Notices 24(4), 22–24
Castagna, G.: Covariance and contravariance: Conflict without a cause. ACM Transactions on Programming Languages and Systems 17(3), 431–447 (1995)
Chambers, C.: Object-Oriented Multimethods in Cecil. In: Lehrmann Madsen, O. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)
Clifton, C., Leavens, G.T., Chambers, C., Millstein, T.: Proceedings of OOPSLA 2000. In: Proceedings of OOPSLA 2000, pp. 130–145 (2000)
Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)
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)
Feinberg, N., Keene, S.E., Mathews, R.O., Washington, P.T.: The Dylan Programming Book. Addison-Wesley Longman, Amsterdam (1996)
Foote, B., Johnson, R.E.: Reflective Facilities in Smalltalk-80. In: OOPSLA 1989 Proceedings, pp. 327–335 (1989)
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)
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)
Gabriel, R.P., White, J.L., Bobrow, D.G.: CLOS: Integrating Object-Oriented and Functional Programming. Communications of the ACM 34 (1991)
Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addision-Wesley, Reading (1995)
Grothoff, C.: Walkabout revisited: The runabout. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743. Springer, Heidelberg (2003)
Goldberg, A., Kay, A. (eds.): with the Learning Research Group. Smalltalk-72 Instruction Manual. Xerox Palo Alto Research Center,
Goldberg, A., Robson, D.: Smalltalk-80: The Language and its Implementation. Addison-Wesley, Reading (1983)
Goldberg, A.: Smalltalk-80: The Interactive Programming Environment. Addison-Wesley, Reading (1984)
Goldberg, D.S., Findler, R.B., Flatt, M.: Super and inner: together at last! In: OOPSLA Proceedings 2004, pp. 116–129 (2004)
Hebel, K.J., Johnson, R.E.: Arithmetic and Double Dispatching in Smalltalk-80. Journal of Object-Oriented Programming 2(6), 40–44 (1990)
Daniel, H., Ingalls., H.: The Smalltalk-76 Programming System: Design and Implementation. In: 5th ACM Symposium on POPL, pp. 9–15 (1978)
Ingalls, D.H.H.: A simple technique for handling multiple polymorphism. In: Proceedings of OOPSLA 1986 (1986)
Johnson, R.E., Graver, J.O., Zurawski, L.W.: TS: An Optimizing Compiler for Smalltalk. In: OOPSLA 1988 Proceedings, pp. 18–26 (1988)
Kiczales, G., Rodriguez, L.: Efficient Method Dispatch in PCL. In: Proceedings of the ACM Conference on Lisp and Functional Programming, pp. 99–105 (1990)
Kiczales, G., Rivieres, J.d., Bobrow, D.G.: The Art of the Metaobject Protocol. MIT Press, Cambridge (1991)
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)
Keene, S.E.: Object-Oriented Programming in Common Lisp: A Programmer’s Introduction to CLOS. Addison-Wesley, Reading (1989)
Krasner, G. (ed.): Smalltalk 80: Bits of History, Words of Advice. Addison-Wesley, Reading (1983)
Kristensen, B.B., Madsen, O.L., Moller-Pedersen, B., Nygaard, K.: Object-Oriented Programming in the Beta Language (1990)
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)
Multiple Dispatch as Dispatch on Tuples. In: OOPSLA Proceedings, pp. 274–287 (1998)
McAffer, J.: Meta-level Programming with CodA. In: Olthoff, W. (ed.) ECOOP 1995. LNCS, vol. 952, pp. 190–214. Springer, Heidelberg (1995)
Maes, P.: Computational Reflection. Artificial Intelligence Laboratory. Vrije Universiteit Brussel. Technical Report 87-2 (1987)
Maes, P.: Concepts and Experiments in Computational Reflection. In: OOPSLA 1987 Proceedings, pp. 147–155 (1987)
Moon, D.: Object-Oriented Programming with Flavors. In: OOPSLA 1986 Proceedings, pp. 1–8 (1986)
Mougin, P., Ducasse, S.: OOPAL: integrating array programming in object-oriented programming. In: OOPSLA Proceedings, pp. 65–77 (2003)
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)
Paepcke, A. (ed.): Object-Oriented Programming: The CLOS Perspective. MIT Press, Cambridge (1993)
Palsberg, J., Jay, C.B., Noble, J.: Experiments with Generic Visitors. In: The Proceedings of theWorkshop on Generic Programming, Marstrand, Sweden (1998)
Palsberg, J., Drunen, J.V.: Visitor oriented programming. In: The Workshop for Foundations of Object-Oriented Programming, FOOL (2004)
F. Rivard. Evolution du comportement des objets dans les langages a classes reflexifs. PhD thesis, Ecole des Mines de Nantes, France (June 1997)
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)
Schärli, N., Black, A.P., Ducasse, S.: Object-oriented encapsulation for dynamically typed languages. In: OOPSLA Proceedings, pp. 130–149 (2004)
Smith, B.C.: Reflection and Semantics in Lisp. In: POPL Proceedings, pp. 23–35 (1984)
Stefik, M., Bobrow, D.G.: Object-Oriented Programming: Themes and Variations. AI Magazine 6(4), 40–62 (1986)
Bjarne Stroustrup.The C++ Programming Language. Addison-Wesley, Reading (1986)
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)
Ungar, D., Smith, R.B.: Self: The Power of Simplicity. In: OOPSLA 1987 Proceedings, pp. 227–242 (1987)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)