Abstract
Commonly used object-oriented languages like C++, Java and C# are single dispatch languages and do not support multiple polymorphic arguments in message dispatch. In this work, we demonstrate simulation of multimethods in single dispatch languages without any change in the language syntax. For realization of multimethods, we use double dispatching (dispatching on each argument in turn), message dispatching using runtime type information (RTTI) (adding multimethod dispatch routine), and reflection (using metadata). We develop a preprocessor to simulate the RTTI technique. We discuss the issues associated with code-reuse and encapsulating multimethods in single dispatch languages.
A Poster presented at IBM-IRL Collaborative Academia Research Exchange (I-CARE) Workshop, New Delhi, Oct 2009.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Chambers, C.: Object-oriented multi-methods in cecil. In: Lehrmann Madsen, O. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)
Ingalls, D.: Simple technique for handling multiple polymorphism. In: OOPSLA, SIGPLAN Notices, vol. 21, pp. 347–349 (1986)
Java multimethod framework, http://igm.univ-mlv.fr/~forax/works/jmmf/
Kumar, R., Agrawal, V.: Multiple dispatch in reflective runtime environment. Computer Language System Structures 33(2), 60–78 (2007)
Naik, M., Kumar, R.: Efficient message dispatch in object-oriented systems. ACM SIGPLAN Notices 35(3), 49–58 (2000)
Stroustrup, B.: The Design and Evolution of C++. Addison Weasley, Reading (1994)
Cmm. C++ with multimethods, http://www.op59.net/cmm/
Aho, A.V., Lam, M., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques and Tools. Addison Wesley, Reading (2006)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bansal, S. (2010). Multiple Polymorphic Arguments in Single Dispatch Object Oriented Languages. In: Ranka, S., et al. Contemporary Computing. IC3 2010. Communications in Computer and Information Science, vol 95. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14825-5_23
Download citation
DOI: https://doi.org/10.1007/978-3-642-14825-5_23
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-14824-8
Online ISBN: 978-3-642-14825-5
eBook Packages: Computer ScienceComputer Science (R0)